sunmingtao / sample-code

3 stars 4 forks source link

Vue js: $error vs $anyError #117

Closed sunmingtao closed 4 years ago

sunmingtao commented 4 years ago

After all the fields have been touched (all the $v.field.$dirty=true), and if at least one of fields contains an error, $v.$error = true

As long as at least one of fields contains an error, $v.$anyError = true. However, if not all the fields have been touched, $v.$error is still false

Check the example on this site (section $error vs $anyError) https://vuelidate.js.org/#sub-data-nesting