Vee-validate: Custom error messages with Validation Provider

Created on 15 May 2019  ยท  1Comment  ยท  Source: logaretm/vee-validate

Hi,

I want to pass an option prop to overwrite default error messages when using ValidationProvider. I checked the documentation and it's advised to set all localization logic in the main bootstrap file and load it once. I couldn't find a way to overwrite them on-the-fly. Can you please help me about that?

Regards.

โ” question

Most helpful comment

You could use the failedRules slot prop to show your own messages:

<ValidationProvider rules="required|email" name="field">
  <div slot-scope="{ errors, failedRules }">
    <input type="text" v-model="value">
    <span v-if="failedRules.required">Come on, this is required!</span>
    <span v-if="failedRules.email">Have you ever seen an email like the one you just entered?</span>
  </div>
</ValidationProvider>

>All comments

You could use the failedRules slot prop to show your own messages:

<ValidationProvider rules="required|email" name="field">
  <div slot-scope="{ errors, failedRules }">
    <input type="text" v-model="value">
    <span v-if="failedRules.required">Come on, this is required!</span>
    <span v-if="failedRules.email">Have you ever seen an email like the one you just entered?</span>
  </div>
</ValidationProvider>
Was this page helpful?
0 / 5 - 0 ratings

Related issues

DanielPe05 picture DanielPe05  ยท  3Comments

yyyuuu777 picture yyyuuu777  ยท  3Comments

Etheryte picture Etheryte  ยท  3Comments

saintplay picture saintplay  ยท  3Comments

triffer picture triffer  ยท  3Comments