Explorar el Código

Form: fix initial error message

Leopoldthecoder hace 7 años
padre
commit
81ff11ad41
Se han modificado 1 ficheros con 6 adiciones y 3 borrados
  1. 6 3
      packages/form/src/form-item.vue

+ 6 - 3
packages/form/src/form-item.vue

@@ -73,9 +73,12 @@
       size: String
     },
     watch: {
-      error(value) {
-        this.validateMessage = value;
-        this.validateState = value ? 'error' : '';
+      error: {
+        immediate: true,
+        handler(value) {
+          this.validateMessage = value;
+          this.validateState = value ? 'error' : '';
+        }
       },
       validateStatus(value) {
         this.validateState = value;