Browse Source

fix(treeTable): treeTable data 模式非深度重载时,如果 reload 参数中没有 data 选项,会清除表格数据的问题 (#1938)

pull/1942/head
morning-star 6 months ago committed by GitHub
parent
commit
7c82e15e85
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 12
      src/modules/treeTable.js

12
src/modules/treeTable.js

@ -176,12 +176,14 @@ layui.define(['table'], function (exports) {
options.parseData.mod = true
}
} else {
options.data = options.data || [];
// 处理 isSimpleData
if (treeOptions.data.isSimpleData) {
options.data = that.flatToTree(options.data);
if(options.data !== undefined){
options.data = options.data || [];
// 处理 isSimpleData
if (treeOptions.data.isSimpleData) {
options.data = that.flatToTree(options.data);
}
that.initData(options.data);
}
that.initData(options.data);
}
if (!reload || (reload && done && !done.mod)) {

Loading…
Cancel
Save