修复 treeTable 数据格式为简单类型时 IE9+ 兼容问题 (#1415)

This commit is contained in:
贤心 2023-10-31 16:15:45 +08:00 committed by GitHub
commit bd275360d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -301,9 +301,13 @@ layui.define(['table'], function (exports) {
}
})
// 返回顶层节点
return Object.values(nodes).filter(function (item) {
return rootPid ? item[pIdKey] === rootPid : !item[pIdKey];
})
return Object.keys(nodes)
.map(function(k) {
return nodes[k];
})
.filter(function (item) {
return rootPid ? item[pIdKey] === rootPid : !item[pIdKey];
})
}
Class.prototype.flatToTree = function (tableData) {