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: {
|
||||
error (val) {
|
||||
this.validateMessage = val;
|
||||
this.validateState = 'error';
|
||||
if (val === '') {
|
||||
this.validateMessage = '';
|
||||
this.validateState = '';
|
||||
} else {
|
||||
this.validateMessage = val;
|
||||
this.validateState = 'error';
|
||||
}
|
||||
},
|
||||
validateStatus (val) {
|
||||
this.validateState = val;
|
||||
|
@ -246,4 +251,4 @@
|
|||
this.dispatch('iForm', 'on-form-item-remove', this);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</script>
|
||||
|
|
Loading…
Add table
Reference in a new issue