Skip to content

useFieldArray with Pinia store #4233

Answered by logaretm
jiblett1000 asked this question in Q&A
Discussion options

You must be logged in to vote

Sorry for the delay, again....

I took a look and seems exactly the same issue as in #4269. If you add keepValuesOnUnmount to useForm it will work.

  const { values } = useForm({
    validationSchema: recipeSchema,
    keepValuesOnUnmount: true,
    initialValues: {
      ingredients: [
        {
          name: '',
          volume: '',
        },
      ],
    },
  });

By default vee-validate removes fields that get unmounted from the values object.

Replies: 5 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@logaretm
Comment options

Comment options

You must be logged in to vote
1 reply
@jiblett1000
Comment options

Answer selected by jiblett1000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants