Explorar el Código

Form-item: rules validate sync (#21892)

bofeng hace 3 años
padre
commit
a2b7304685
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      packages/form/src/form-item.vue

+ 5 - 0
packages/form/src/form-item.vue

@@ -95,6 +95,11 @@
       },
       validateStatus(value) {
         this.validateState = value;
+      },
+      rules(value) {
+        if ((!value || value.length === 0) && this.required === undefined) {
+          this.clearValidate();
+        }
       }
     },
     computed: {