Explorar o código

Form: add validateOnRuleChange (#8141)

badpunman %!s(int64=7) %!d(string=hai) anos
pai
achega
c1fbffe051
Modificáronse 1 ficheiros con 8 adicións e 2 borrados
  1. 8 2
      packages/form/src/form.vue

+ 8 - 2
packages/form/src/form.vue

@@ -34,11 +34,17 @@
         type: Boolean,
         default: true
       },
-      size: String
+      size: String,
+      validateOnRuleChange: {
+        type: Boolean,
+        default: true
+      }
     },
     watch: {
       rules() {
-        this.validate();
+        if (this.validateOnRuleChange) {
+          this.validate(() => {});
+        }
       }
     },
     data() {