0

Am mtrying to validate all inputs via

 this.validator.validateAll().then((result) => {
               console.log(result)
            }).catch(() => {
                // something went wrong (non-validation related).
                return false;
            });

But am getting an error

 Cannot read property 'then' of undefined

When i check on

console.log(this.validator)  

the function validateAll doesn't exists.Previously the above was working untill today

The following is my package.json dependency

 "devDependencies": {
     "vue": "^2.1.10"
  },

  "dependencies": {
    "vee-validate": "^2.0.0-rc.21",
   }

What could be wrong as it started throwing errors after running

npm install vee-validate --save

What do i need to do as it was previously working?

2
  • 1
    Maybe $validator? Commented Nov 13, 2017 at 11:53
  • even when using $validator am still getting the error on the console but the validation is working Commented Nov 13, 2017 at 12:16

1 Answer 1

1

This.validator means you want to access to a Vue component property. But the plugin use this.$validator wich is an injected property by the plugin itself.

http://vee-validate.logaretm.com/examples.html#validate-form

Sign up to request clarification or add additional context in comments.

2 Comments

even when using $validator am still getting the error on the console but the validation is working
So provide us a test link to see the bug in action.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.