Version:
- VueJs: 2.2.6
- Vee-Validate: ^ 2.0.0-beta.25
Description:
I am working on a project where I use laravel-vue-starter
as the base template.
I want to use custom password verification. So I created a resource file \ assets \ js \ validators \ passwordValidators.js with the code:
import { Validator } from 'vee-validate';
Validator.extend('password', {
getMessage: field => 'Insert a strong password, it should contain Uppercase letter, lowercase letter, number and special character',
validate: value => /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.[\W]).{8,}$/.test(value)
});
But when I add v-validate="'password'"
it leads to an error[vee-validate] No such validator 'password' exists
Any help would be appreciated.
source
share