Browse Source

修复 `treeTable.reloadData()` 在某些情况下报错的问题

Closes: https://gitee.com/layui/layui/issues/I8M5HS
pull/1438/head^2
贤心 12 months ago
parent
commit
3f148a9086
  1. 2
      src/modules/treeTable.js

2
src/modules/treeTable.js

@ -93,7 +93,7 @@ layui.define(['table'], function (exports) {
var updateCache = function (id, childrenKey, data) { var updateCache = function (id, childrenKey, data) {
var tableCache = table.cache[id]; var tableCache = table.cache[id];
layui.each(data || tableCache, function (index, item) { layui.each(data || tableCache, function (index, item) {
var itemDataIndex = item[LAY_DATA_INDEX]; var itemDataIndex = item[LAY_DATA_INDEX] || '';
if (itemDataIndex.indexOf('-') !== -1) { if (itemDataIndex.indexOf('-') !== -1) {
tableCache[itemDataIndex] = item tableCache[itemDataIndex] = item
} }

Loading…
Cancel
Save