Skip to content

Commit

Permalink
fixs:Form组件下的initModel,删除model 中的对应的 field未兼容number类型0的场景
Browse files Browse the repository at this point in the history
  • Loading branch information
sixiTr committed Aug 19, 2024
1 parent 7b8e58e commit 201711f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Form/src/helper/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
}
Expand Down

0 comments on commit 201711f

Please sign in to comment.