Skip to content

[v4] Form not validating in nuxt3 #3861

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

You must be logged in to vote

The order of calling useField and useForm is important.

const { handleSubmit, errors } = useForm({
  validationSchema,
});

const { errorMessage, meta, value: firstName } = useField('firstName');

This is not a recommended way to use useField as it is meant to create input components. But if you do use it like that then you need to make sure the form is created first.

Replies: 1 comment 1 reply

Comment options

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

Answer selected by melokki
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