I've got a parent component with a submit button
<v-card flat>
<child-component :submit="submit()"></child-component>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn @click="submit" type="submit">Change password</v-btn>
</v-card-actions>
</v-card>
and a child component with a form that has a @submit.prevent that I need to call whenever I click the button on the parent:
<v-form @submit.prevent="submit">....</v-form>
My submit()
is on the parent, it's just a simple function that submits the data to a database. It requires parameter X
.
The reason I have a @submit.prevent
on the child form is that I can press enter to submit the form.
How can I pass the submit()
as a prop to the child? Or how can I call submit from the child component?