Skip to content

Commit

Permalink
fix: 🐛 权限管理=>菜单管理=>编辑菜单名称等需要链表meta的内容失效
Browse files Browse the repository at this point in the history
  • Loading branch information
ShanYi-Hui committed Jun 26, 2024
1 parent 0e2f0a3 commit 3b8f425
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/Form/src/helper/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,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
}

0 comments on commit 3b8f425

Please sign in to comment.