From 79ae8006a87dd25411348d1c38976037b1e21361 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Tue, 30 Nov 2021 22:23:44 +0800 Subject: [PATCH] fix: form change value not trigger validate #4955 close $4955 --- components/form/FormItem.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/components/form/FormItem.tsx b/components/form/FormItem.tsx index efef0d916..e237aa98a 100644 --- a/components/form/FormItem.tsx +++ b/components/form/FormItem.tsx @@ -285,6 +285,12 @@ export default defineComponent({ resetField, }); + // instead useProvideFormItemContext onFieldChange + watch(fieldValue, () => { + if (props.autoLink) { + onFieldChange(); + } + }); useProvideFormItemContext( { id: fieldId, @@ -294,9 +300,9 @@ export default defineComponent({ } }, onFieldChange: () => { - if (props.autoLink) { - onFieldChange(); - } + // if (props.autoLink) { + // onFieldChange(); + // } }, clearValidate, },