From 3fe3c363ce2655b5ec7101452dffb2c0a8a96455 Mon Sep 17 00:00:00 2001 From: bofeng Date: Thu, 2 Jun 2022 17:27:33 +0800 Subject: [PATCH] Form-item: rules validate sync (#21892) --- packages/form/src/form-item.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/form/src/form-item.vue b/packages/form/src/form-item.vue index e072f389f5e..c07df6e2ee5 100644 --- a/packages/form/src/form-item.vue +++ b/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: {