Skip to content
Advertisement

How to configure vee-validate globally in vue?

My question, is there a way we could create a one .js file and state all extend(s)? so we don’t need to extend each time we use the validator.

I just ask because my codes becomes lengthy each time I need a validator. I need to extend it first to be usable.


I’m currently using vue & vuetify with vee-validate. The below codes are working fine reference.

template

JavaScript

script

JavaScript

Advertisement

Answer

Yes, you can declare all your configuration in one file, then import that into your main.js. So, you’d have

JavaScript

In main:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement