Skip to content
This repository has been archived by the owner on Dec 25, 2017. It is now read-only.

Commit

Permalink
feat(api): expose vm and el property at the validator function co…
Browse files Browse the repository at this point in the history
…ntext

Closes #63 #165
  • Loading branch information
kazupon committed Mar 12, 2016
1 parent df5e35e commit faaf4ca
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions src/validations/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,17 @@ export default class BaseValidation {
this._detectChange = detectChange
}

get detectChange () {
return this._detectChange
}
get vm () { return this._vm }

set detectChange (val) {
this._detectChange = val
}
get el () { return this._el }

get detectBlur () {
return this._detectBlur
}
get detectChange () { return this._detectChange }

set detectBlur (val) {
this._detectBlur = val
}
set detectChange (val) { this._detectChange = val }

get detectBlur () { return this._detectBlur }

set detectBlur (val) { this._detectBlur = val }

manageElement (el) {
const scope = this._getScope()
Expand Down Expand Up @@ -276,7 +272,7 @@ export default class BaseValidation {
}

_invokeValidator (vm, validator, val, arg, cb) {
let future = validator.call(vm, val, arg)
let future = validator.call(this, val, arg)
if (typeof future === 'function') { // function
if (future.resolved) {
// cached
Expand Down

0 comments on commit faaf4ca

Please sign in to comment.