Best practices for a shared validation state between multiple Vue components? #4791
Unanswered
matthew-dean
asked this question in
Q&A
Replies: 0 comments
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.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a very large component form that, for DX, is broken up into multiple sub-components. Before adding Vee-Validate / Valibot, this process was more or less straightforward, with form values being passed in as v-model props to specific sub-components.
However, what I want to do is to maintain one "validation state" for all of the sub-components, which implies a single
useForm
instance (I think?). I can't find any documentation or examples for the best way to do this. Are there common patterns to "share" Vee-Validate state between multiple components? Any best practices?Note, this is TypeScript + Vue -- so I'm also looking for the best way to define types if I am passing around the same returned object.
Beta Was this translation helpful? Give feedback.
All reactions