Update form-item.vue

修正`FormItem`使用`:error`动态设置错误信息后,`validateState`的值`error`永远无法清空的BUG
This commit is contained in:
吕庆安 2017-09-30 03:40:21 -05:00 committed by GitHub
parent 4ef54c6ea9
commit 4109caadd8

View file

@ -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>