0

I recently started learning to build a SPA with Vue and today i'm looking into Vee-Validate.

With Vee-Validate, the validation needs the name attribute to be filled. If not, we get the following warning: [vee-validate] A field is missing a "name" or "data-vv-name" attribute.

That's ok but i feel it's a little bit redundant to fill this attribute since i'm not using it at all. I get what the user entered with v-model and i send it to the server with an ajax post request. Having to fill this attribute give me this kind of tag: <input name="firstname" v-model="firstname" v-validate="'required'" />, where the name="firstname" is only usefull to Vee-Validate.

With all this in mind, is there a way to tell Vee-Validate to use the v-model instead of the name attribute? Thank you

Anthony Aslangul
  • 3,589
  • 2
  • 20
  • 30

1 Answers1

0

As far as is not possible, the name or data-vv-name attribute contains a string that is used as input to generate error messages and is the attribute on which the library is based to customize error messages, for example i18n support.