Merge pull request #537 from sixiTr/fixs-initModel

fix: initModel判断schema对应的field是否存在,兼容null与0等场景
master
Archer 1 year ago committed by GitHub
commit ed301a5b9d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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

Loading…
Cancel
Save