在遍历之前,先判断是否存在row.children (#103)
Cannot read property 'forEach' of undefined 展开日志详情报错,找不到forEach属性
This commit is contained in:
@@ -511,17 +511,18 @@ function CRUD(options) {
|
||||
return
|
||||
}
|
||||
const lazyTreeNodeMap = table.store.states.lazyTreeNodeMap
|
||||
const children = lazyTreeNodeMap[crud.getDataId(row)]
|
||||
row.children = children
|
||||
children.forEach(ele => {
|
||||
const id = crud.getDataId(ele)
|
||||
if (that.dataStatus[id] === undefined) {
|
||||
that.dataStatus[id] = {
|
||||
delete: 0,
|
||||
edit: 0
|
||||
row.children = lazyTreeNodeMap[crud.getDataId(row)]
|
||||
if (row.children) {
|
||||
row.children.forEach(ele => {
|
||||
const id = crud.getDataId(ele)
|
||||
if (that.dataStatus[id] === undefined) {
|
||||
that.dataStatus[id] = {
|
||||
delete: 0,
|
||||
edit: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user