Parcourir la source

Form: fix initial error message

Leopoldthecoder il y a 7 ans
Parent
commit
81ff11ad41
1 fichiers modifiés avec 6 ajouts et 3 suppressions
  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;