Skip to content

Commit

Permalink
修正 动态删除应删除错误信息
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuMY authored and LiuMY committed Jun 15, 2016
1 parent b8eae38 commit 20cda95
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions dist/validator.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* validate-framework v1.4.0
* validate-framework v1.4.1
* 轻量级JavaScript表单验证,字符串验证。
*
* Copyright (c) 2016 LMY
Expand Down Expand Up @@ -336,12 +336,12 @@
// 移除对象
if (this.fields[fieldNames[i]]) {
delete this.fields[fieldNames[i]];
delete this.errors[fieldNames[i]];
this.errors && delete this.errors[fieldNames[i]];
}
}
} else if (fieldNames && this.fields[fieldNames]) {
delete this.fields[fieldNames];
delete this.errors[fieldNames];
this.errors && delete this.errors[fieldNames];
}
return this;
},
Expand Down
4 changes: 2 additions & 2 deletions dist/validator.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,12 +375,12 @@ Validator.prototype = {
// 移除对象
if (this.fields[fieldNames[i]]) {
delete this.fields[fieldNames[i]];
delete this.errors[fieldNames[i]];
this.errors && delete this.errors[fieldNames[i]];
}
}
} else if (fieldNames && this.fields[fieldNames]) {
delete this.fields[fieldNames];
delete this.errors[fieldNames];
this.errors && delete this.errors[fieldNames];
}
return this;
},
Expand Down

0 comments on commit 20cda95

Please sign in to comment.