From b41e3939ac4b744b0798b483247d6d48878a2707 Mon Sep 17 00:00:00 2001 From: Henry Rao <1047422165@qq.com> Date: Wed, 13 Apr 2022 19:45:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DupdateSchema=E4=B9=8B?= =?UTF-8?q?=E5=90=8E=E4=BC=9A=E6=8A=8A=E5=B7=B2=E5=A1=AB=E5=80=BC=E9=87=8D?= =?UTF-8?q?=E7=BD=AE=E4=B8=BAdefaultValue=E7=9A=84=E9=97=AE=E9=A2=98=20(#1?= =?UTF-8?q?792)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Form/src/hooks/useFormValues.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Form/src/hooks/useFormValues.ts b/src/components/Form/src/hooks/useFormValues.ts index 0bae86ac..b5492dfe 100644 --- a/src/components/Form/src/hooks/useFormValues.ts +++ b/src/components/Form/src/hooks/useFormValues.ts @@ -118,7 +118,10 @@ export function useFormValues({ const { defaultValue } = item; if (!isNullOrUnDef(defaultValue)) { obj[item.field] = defaultValue; - formModel[item.field] = defaultValue; + + if (formModel[item.field] === undefined) { + formModel[item.field] = defaultValue; + } } }); defaultValueRef.value = obj;