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

pull/1942/head
morning-star 6 months ago committed by GitHub
parent a1472b3561
commit 7c82e15e85
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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

Loading…
Cancel
Save