kazupon / vue-validator

:white_check_mark: Validator component for Vue.js
MIT License
2.19k stars 431 forks source link

Async select validation #237

Closed erguotou520 closed 8 years ago

erguotou520 commented 8 years ago

vue & vue-validator version

vue: 1.0.24 vue-validator: 2.1.1

Reproduction Link

https://jsfiddle.net/nkccqdy7/

What is Expected?

$validation.foo.required to be false

What is actually happening?

$validation.foo.required to be true

kazupon commented 8 years ago

Thank you for your reporting!!

I found your mistake.

setTimeout(function() {
  this.foo = '2'; // `this` context is "function"
 }, 500);
erguotou520 commented 8 years ago

Sorry for mistake, updated. https://jsfiddle.net/nkccqdy7/1/

kazupon commented 8 years ago

one more thing, I found the your mistake about validation rule.

please, see the below: https://jsfiddle.net/kazupon/0qbxysyh/3/

erguotou520 commented 8 years ago

Yes, I know it, so in the demo #238 fixed.