I'm trying to figure out how to pass the parent component's method to the child component. Here's the scenario: when I click the confirm button on my modal (child component), it needs to send the data from the parent form (parent component).
Here is the method in the parent component:
<b-form @submit.prevent="onSubmit">
.......
</b-form>
async onSubmit() {
this.errors = false;
await this.$store.commit('commit_contractable_id', this.id)
await this.$store.dispatch('create_contract', this.form)
},
And here is the confirm button in my child component modal:
<button type="submit" class="btn btn-lg btn-outline-primary w-50" data-dismiss="modal">
Confirm
</button>
My goal is for the function in the parent component to be executed when I click the confirm button.