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