logaretm / vee-validate

✅ Painless Vue forms
https://vee-validate.logaretm.com/v4
MIT License
10.79k stars 1.26k forks source link

setErrors method problem #4865

Closed gspgsp closed 4 days ago

gspgsp commented 1 month ago

What happened?

I found that all the hint message will show at the same time, and this is what i wanted, but when my mouse clicks on one of the input boxes, such as name field, the hint of the current input box will disappear, and the hint of the input box that I didn't click on (here is age field) will also disappear. i want to achiveve, click who's input box, the current input box's hint will disappear, not all.

Reproduction steps

what i test.

fieldName.setErrors(data? .data.name); 
fieldAge.setErrors(data? .data.age); 

env: "@vee-validate/nuxt": "^4.13.2", "@vee-validate/yup": "^4.13.2", "vue": "^3.5.5",

node: v20.15.0

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

jsut on my local env

Code of Conduct

logaretm commented 4 days ago

I don't have much to go on here with. But I will take a guess, Your button might be submitting the form at the same time it is setting the error, have you tried setting the button type to button?

Other than that I can't help unless you provide a reproduction for this.