From 3cc72d67913c3fc44a774bd0da6430c45d9b3d9d Mon Sep 17 00:00:00 2001 From: Tanimodori Date: Sun, 26 Jun 2022 12:47:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0Schema=E6=97=B6?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=80=BC=E4=B8=8D=E5=BA=94=E8=A6=86=E7=9B=96?= =?UTF-8?q?=E5=B7=B2=E6=9C=89=E5=80=BC=EF=BC=8Cfix=20#1997=20(#2003)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Form/src/hooks/useFormEvents.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/Form/src/hooks/useFormEvents.ts b/src/components/Form/src/hooks/useFormEvents.ts index 30e9f87a..4fa96bc4 100644 --- a/src/components/Form/src/hooks/useFormEvents.ts +++ b/src/components/Form/src/hooks/useFormEvents.ts @@ -230,12 +230,14 @@ export function useFormEvents({ } const obj: Recordable = {}; + const currentFieldsValue = getFieldsValue(); schemas.forEach((item) => { if ( item.component != 'Divider' && Reflect.has(item, 'field') && item.field && - !isNullOrUnDef(item.defaultValue) + !isNullOrUnDef(item.defaultValue) && + !(item.field in currentFieldsValue) ) { obj[item.field] = item.defaultValue; }