From 54fbe0ec8331f52d0a231b72e5191aaa2cb9d08d Mon Sep 17 00:00:00 2001 From: sixiTr Date: Mon, 19 Aug 2024 17:25:23 +0800 Subject: [PATCH] =?UTF-8?q?fixs:Form=E7=BB=84=E4=BB=B6=E4=B8=8B=E7=9A=84in?= =?UTF-8?q?itModel,=E5=88=A0=E9=99=A4model=20=E4=B8=AD=E7=9A=84=E5=AF=B9?= =?UTF-8?q?=E5=BA=94=E7=9A=84=20field=E6=9C=AA=E5=85=BC=E5=AE=B9number?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B0=E7=9A=84=E5=9C=BA=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 dc52589..3ddb1b4 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)) { + if (!get(model, key) && get(model, key) !== 0) { delete model[key] } }