From f236109945ca5b90108178891b744e776634da0d Mon Sep 17 00:00:00 2001 From: sixiTr Date: Wed, 18 Sep 2024 16:45:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20initModel=E5=88=A4=E6=96=ADschema?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E7=9A=84field=E6=98=AF=E5=90=A6=E5=AD=98?= =?UTF-8?q?=E5=9C=A8,=E5=85=BC=E5=AE=B9null=E4=B8=8E0=E7=AD=89=E5=9C=BA?= =?UTF-8?q?=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Form/src/helper/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Form/src/helper/index.ts b/src/components/Form/src/helper/index.ts index 3ddb1b4..9a38585 100644 --- a/src/components/Form/src/helper/index.ts +++ b/src/components/Form/src/helper/index.ts @@ -161,7 +161,7 @@ export const initModel = (schema: FormSchema[], formModel: Recordable) => { // 如果 schema 对应的 field 不存在,则删除 model 中的对应的 field for (let i = 0; i < schema.length; i++) { const key = schema[i].field - if (!get(model, key) && get(model, key) !== 0) { + if (!model.hasOwnProperty(key)) { delete model[key] } }