0

I have followed the tutorial here:

http://frankclark.xyz/veevalidate-strong-password-and-confirmation-validation

to create a custom password validator.

I'm now trying to move that code into a single file component.

I have created a file called Password.vue and have put the HTML within <template></template> tags without issue.

But when I add the JavaScript:

import VeeValidate from 'vee-validate';

Vue.use(VeeValidate);

VeeValidate.Validator.extend('verify_password', {
    getMessage: field => `The password must contain at least: 1 uppercase letter, 1 lowercase letter, 1 number, and one special character (E.g. , . _ & ? etc)`,
    validate: value => {
        var strongRegex = new RegExp("^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})");
        return strongRegex.test(value);
    }
});

inside <script></script> tags, I get the following error message:

Uncaught TypeError: Cannot set property 'render' of undefined

What am I doing wrong?

Hoa
  • 19,858
  • 28
  • 78
  • 107

0 Answers0