From b41e3939ac4b744b0798b483247d6d48878a2707 Mon Sep 17 00:00:00 2001 From: Henry Rao <1047422165@qq.com> Date: 星期三, 13 四月 2022 19:45:55 +0800 Subject: [PATCH] fix: 修复updateSchema之后会把已填值重置为defaultValue的问题 (#1792) --- src/components/Form/src/hooks/useFormValues.ts | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/src/components/Form/src/hooks/useFormValues.ts b/src/components/Form/src/hooks/useFormValues.ts index 0bae86a..b5492df 100644 --- a/src/components/Form/src/hooks/useFormValues.ts +++ b/src/components/Form/src/hooks/useFormValues.ts @@ -118,7 +118,10 @@ 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; -- Gitblit v1.8.0