Multi Step Form Validation with child components #3737
Unanswered
sunil-dzango
asked this question in
Q&A
Replies: 1 comment
-
I'm assuming each step uses either <template>
<div>
<FirstStep v-if="currentStep === 1" @submit="onStepSubmit" />
<SecondStep v-if="currentStep === 2" @submit="onStepSubmit" />
<LastStep v-if="currentStep === 3" @submit="onAllSubmit" />
</div>
</template>
<script>
export default {
data: () => ({
allData: {},
}),
methods: {
onStepSubmit(data) {
this.allData = Object.assign({}, this.allData, data);
this.currentStep++;
},
onAllSubmit(data) {
this.allData = Object.assign({}, this.allData, data);
// send this.allData to server
}
}
</script Alternatively, you could remove the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am creating a wizard where where a form is multiple steps. I found this documentation:
Multi-step Form Wizard
The problem is I have a component for each step form like follows:
In previous Vee Validate versions, I was able to provide validator on the parent component as
And inject the validator in child components. So, I could use this.$validator.validateAll() in onNext() function. I have not been able to recreate this in the v4.0. Are there additional steps to achieve this?
Beta Was this translation helpful? Give feedback.
All reactions