Merge pull request #519 from sixiTr/fixs-Form-initModel

fixs:Form组件下的initModel,删除model 中的对应的 field未兼容number类型0的场景
This commit is contained in:
Archer 2024-08-19 17:57:27 +08:00 committed by GitHub
commit f0832bf1cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -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]
}
}