I would like to be able to validate all the components (with multiple fields) in my form independently from eachother using Vee-validate.
I read this topic. However, the solutions have all components be validated at the same time. I've tried using an EventBus (unsuccesfully) and I would prefer staying away from it.
I have multi step form which should validate the current step before clicking 'continue'. Example:
-- Step 1
---- <component-one /> == component with fields
---- (next button) <-- validate content 1. If valid, go to step 2
-- Step 2
---- <component-two /> == component with fields
---- (next button) <-- validate content 2. If valid, go to step 2
-- Step 3
---- <component-three/> == component with fields
---- (next button) <-- validate content 3. If valid, go to step 3
My issue is that I have to call this.validator
on component level to be able to validate the component. The continue button, however, lives on the parent level. I cannot create one shared $validator
because then all steps have to be valid in order to continue (which is impossible)/