fix: #465
This commit is contained in:
parent
e0bc713f06
commit
8996e01ca3
|
@ -159,11 +159,11 @@ export const initModel = (schema: FormSchema[], formModel: Recordable) => {
|
|||
}
|
||||
})
|
||||
// 如果 schema 对应的 field 不存在,则删除 model 中的对应的 field
|
||||
Object.keys(model).forEach((key) => {
|
||||
const isExist = schema.some((item) => item.field === key)
|
||||
if (!isExist) {
|
||||
for (let i = 0; i < schema.length; i++) {
|
||||
const key = schema[i].field
|
||||
if (!get(model, key)) {
|
||||
delete model[key]
|
||||
}
|
||||
})
|
||||
}
|
||||
return model
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue