Closed mohammadali0120 closed 2 years ago
That is expected. When you click submit vee-validate clears the errors and replaces them with the ones it knows about by running the validation rule.
If you want to have custom errors then you need to set them after submission. I don't see you trying to set them anywhere other than after input
which is unrelated to submit
events.
Luckily it is easier to do so than with input events, you can call actions.setErrors
in the submit handler. Like here in the docs.
The same mechanism exists for components API as well.
What happened?
I think there is one problem with setting error manually when I set a manual error, e.g when I click on submit button, without any attention to my condition manual error gets disappeared I don't get this what would be the reason for an error to gets disappear without my condition getting true?
In the example link, you can see both
composition-api
andcomponents
approaches that both of them won't work as expected,Am I made a mistake somewhere or this is a bug?
Reproduction steps
1. 2. 3. ...
Version
Vue.js 3.x and vee-validate 4.x
What browsers are you seeing the problem on?
Relevant log output
No response
Demo link
https://stackblitz.com/edit/nuxt-starter-udh7b4
Code of Conduct