Skip to content

Commit 655c90b

Browse files
cs1707abigail-0111
authored andcommitted
Table: fix lazy load data (ElemeFE#21041)
1 parent 53a9747 commit 655c90b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/table/src/store/tree.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,14 @@ export default {
187187

188188
loadData(row, key, treeNode) {
189189
const { load } = this.table;
190-
const { lazyTreeNodeMap, treeData } = this.states;
191-
if (load && !treeData[key].loaded) {
192-
treeData[key].loading = true;
190+
const { treeData: rawTreeData } = this.states;
191+
if (load && !rawTreeData[key].loaded) {
192+
rawTreeData[key].loading = true;
193193
load(row, treeNode, data => {
194194
if (!Array.isArray(data)) {
195195
throw new Error('[ElTable] data must be an array');
196196
}
197+
const { lazyTreeNodeMap, treeData } = this.states;
197198
treeData[key].loading = false;
198199
treeData[key].loaded = true;
199200
treeData[key].expanded = true;

0 commit comments

Comments
 (0)