update files

This commit is contained in:
nuintun
2015-11-23 15:23:34 +08:00
parent 469ebd9744
commit ea69932db8
6 changed files with 105 additions and 49 deletions

View File

@@ -56,19 +56,22 @@ module.exports = Vue.component('dynamic-item', {
this.value = this.value.trim();
// name error
if (!this.name) {
this.nameError = '不能为空';
} else if (this.uniqueItems[this.name]) {
this.nameError = ' ' + this.name + ' 已存在';
if (this.name) {
if (this.uniqueItems[this.name]) {
this.nameError = ' ' + this.name + ' 已存在';
} else {
this.nameError = '';
}
} else {
this.nameError = '';
this.nameError = '不能为空';
}
// value error
if (!this.value) {
this.valueError = '不能为空';
} else {
if (this.value) {
this.valueError = '';
} else {
this.valueError = '不能为空';
}
// add item