Update form-item.vue
修正`FormItem`使用`:error`动态设置错误信息后,`validateState`的值`error`永远无法清空的BUG
This commit is contained in:
parent
4ef54c6ea9
commit
4109caadd8
1 changed files with 8 additions and 3 deletions
|
@ -85,8 +85,13 @@
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
error (val) {
|
error (val) {
|
||||||
this.validateMessage = val;
|
if (val === '') {
|
||||||
this.validateState = 'error';
|
this.validateMessage = '';
|
||||||
|
this.validateState = '';
|
||||||
|
} else {
|
||||||
|
this.validateMessage = val;
|
||||||
|
this.validateState = 'error';
|
||||||
|
}
|
||||||
},
|
},
|
||||||
validateStatus (val) {
|
validateStatus (val) {
|
||||||
this.validateState = val;
|
this.validateState = val;
|
||||||
|
@ -246,4 +251,4 @@
|
||||||
this.dispatch('iForm', 'on-form-item-remove', this);
|
this.dispatch('iForm', 'on-form-item-remove', this);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Add table
Reference in a new issue