Commit 02bf8fab66f928b58531e51f72288e9e5f15657b

Authored by 梁灏
1 parent 4109caad

simplify

Showing 1 changed file with 2 additions and 7 deletions   Show diff stats
src/components/form/form-item.vue
... ... @@ -85,13 +85,8 @@
85 85 },
86 86 watch: {
87 87 error (val) {
88   - if (val === '') {
89   - this.validateMessage = '';
90   - this.validateState = '';
91   - } else {
92   - this.validateMessage = val;
93   - this.validateState = 'error';
94   - }
  88 + this.validateMessage = val;
  89 + this.validateState = val === '' ? '' : 'error';
95 90 },
96 91 validateStatus (val) {
97 92 this.validateState = val;
... ...