Commit c9985ada18c7303b12ffbefe5be24b00b5e849c6
1 parent
fdcf4cb6
fix #5352
Showing
1 changed file
with
6 additions
and
3 deletions
Show diff stats
src/components/form/form-item.vue
... | ... | @@ -84,9 +84,12 @@ |
84 | 84 | }; |
85 | 85 | }, |
86 | 86 | watch: { |
87 | - error (val) { | |
88 | - this.validateMessage = val; | |
89 | - this.validateState = val === '' ? '' : 'error'; | |
87 | + error: { | |
88 | + handler (val) { | |
89 | + this.validateMessage = val; | |
90 | + this.validateState = val ? 'error' : ''; | |
91 | + }, | |
92 | + immediate: true | |
90 | 93 | }, |
91 | 94 | validateStatus (val) { |
92 | 95 | this.validateState = val; | ... | ... |