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

Commit

Permalink
fix(v-validate): friendly error for field name missing (#205) by @xjc…
Browse files Browse the repository at this point in the history
  • Loading branch information
xjchengo authored and kazupon committed Apr 26, 2016
1 parent caea130 commit 35c01d3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/directives/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ export default function (Vue) {
return
}

if ((process.env.NODE_ENV !== 'production')
&& !(this.arg || this.params.field)) {
warn('you need specify field name for v-validate directive.')
this._invalid = true
return
}

let validatorName = this.vm.$options._validator
if ((process.env.NODE_ENV !== 'production') && !validatorName) {
warn('v-validate need to use into validator element directive: '
Expand Down

0 comments on commit 35c01d3

Please sign in to comment.