I'm using vee-validate 3.x
I'd like to validate a form contained in a child component from the parent component.
Parent
<form-wizard>
<tab-content :before-change="() => validateStep('firstStep')">
<first-step ref="firstStep"></first-step>
</tab-content>
<tab-content>Step 2</tab-content>
Child (firstStep)
<div>
<ValidationProvider rules="required" ref="firstStep" v-slot="{ errors }">
<input v-model="value" type="text" />
<span>{{ errors[0] }}</span>
</ValidationProvider>
</div>
Here is a minimum code reproduction of the issue
https://codesandbox.io/s/vue-template-m17sn
I've got this error when validateStep is executed
[Vue warn]: Error in v-on handler: "TypeError: this.$refs[ref].validate is not a function"
Question
I have the feeling the issue is related with ref
, I've been looking around but did not manage to find a solution.