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

Commit

Permalink
⚡ improvement(warning): changed warning for when the elements under v…
Browse files Browse the repository at this point in the history
…alidation are not wrapped in a <validator> element. (#224) by @SERVANT14

- Changed warning for when the existing <validator> element does not have a name attribute.
  • Loading branch information
marktinsley authored and kazupon committed May 13, 2016
1 parent 57fd2ab commit ec1f223
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions dist/vue-validator.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ function Validate (Vue) {

var validatorName = this.vm.$options._validator;
if (process.env.NODE_ENV !== 'production' && !validatorName) {
warn('v-validate need to use into validator element directive: ' + '(e.g. <validator name="validator">' + '<input type="text" v-validate:field1="[\'required\']">' + '</validator>).');
warn('you need to wrap the elements to be validated in a <validator> element: ' + '(e.g. <validator name="validator">' + '<input type="text" v-validate:field1="[\'required\']">' + '</validator>).');
this._invalid = true;
return;
}
Expand Down Expand Up @@ -2377,7 +2377,7 @@ function Validator (Vue) {
var params = this.params;

if (process.env.NODE_ENV !== 'production' && !params.name) {
warn('validator element directive need to specify \'name\' param attribute: ' + '(e.g. <validator name="validator1">...</validator>)');
warn('validator element requires a \'name\' attribute: ' + '(e.g. <validator name="validator1">...</validator>)');
return;
}

Expand Down
4 changes: 2 additions & 2 deletions dist/vue-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ var validators = Object.freeze({

var validatorName = this.vm.$options._validator;
if ('development' !== 'production' && !validatorName) {
warn('v-validate need to use into validator element directive: ' + '(e.g. <validator name="validator">' + '<input type="text" v-validate:field1="[\'required\']">' + '</validator>).');
warn('you need to wrap the elements to be validated in a <validator> element: ' + '(e.g. <validator name="validator">' + '<input type="text" v-validate:field1="[\'required\']">' + '</validator>).');
this._invalid = true;
return;
}
Expand Down Expand Up @@ -2381,7 +2381,7 @@ var validators = Object.freeze({
var params = this.params;

if ('development' !== 'production' && !params.name) {
warn('validator element directive need to specify \'name\' param attribute: ' + '(e.g. <validator name="validator1">...</validator>)');
warn('validator element requires a \'name\' attribute: ' + '(e.g. <validator name="validator1">...</validator>)');
return;
}

Expand Down
2 changes: 1 addition & 1 deletion docs/zh-cn/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
### jsdelivr

```html
<script src="https://cdn.jsdelivr.net/vue.validator/2.0.2/vue-validator.min.js"></script>
<script src="https://cdn.jsdelivr.net/vue.validator/2.1.1/vue-validator.min.js"></script>
```

## NPM
Expand Down
2 changes: 1 addition & 1 deletion src/directives/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default function (Vue) {

let validatorName = this.vm.$options._validator
if ((process.env.NODE_ENV !== 'production') && !validatorName) {
warn('v-validate need to use into validator element directive: '
warn('you need to wrap the elements to be validated in a <validator> element: '
+ '(e.g. <validator name="validator">'
+ '<input type="text" v-validate:field1="[\'required\']">'
+ '</validator>).')
Expand Down
2 changes: 1 addition & 1 deletion src/directives/validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function (Vue) {
const params = this.params

if (process.env.NODE_ENV !== 'production' && !params.name) {
warn('validator element directive need to specify \'name\' param attribute: '
warn('validator element requires a \'name\' attribute: '
+ '(e.g. <validator name="validator1">...</validator>)'
)
return
Expand Down

0 comments on commit ec1f223

Please sign in to comment.