Skip to content

Commit

Permalink
Table: fixed loading icon not display
Browse files Browse the repository at this point in the history
  • Loading branch information
ziyoung committed Jun 3, 2019
1 parent feb0034 commit 6fb0d57
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions packages/table/src/store/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export default {
} else {
const { loaded = false, loading = false } = oldValue || {};
newTreeData[key] = {
lazy: true,
loaded: !!loaded,
loading: !!loading,
expanded: getExpanded(oldValue, key),
Expand Down
15 changes: 7 additions & 8 deletions packages/table/src/table-body.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@ export default {
indent: treeRowData.level * treeIndent,
level: treeRowData.level
};
// TODO: 优化这里的逻辑
if (typeof treeRowData.expanded === 'boolean') {
data.treeNode.expanded = treeRowData.expanded;
// 表明是懒加载
Expand Down Expand Up @@ -418,10 +417,10 @@ export default {
level: cur.level,
display: true
};
if (typeof cur.loaded === 'boolean' && cur.loaded) {
treeRowData.noLazyChildren = !(cur.children && cur.children.length);
}
if (typeof cur.loading === 'boolean') {
if (typeof cur.lazy === 'boolean') {
if (typeof cur.loaded === 'boolean' && cur.loaded) {
treeRowData.noLazyChildren = !(cur.children && cur.children.length);
}
treeRowData.loading = cur.loading;
}
}
Expand Down Expand Up @@ -451,10 +450,10 @@ export default {
// 懒加载的某些节点,level 未知
cur.level = cur.level || innerTreeRowData.level;
cur.display = !!(cur.expanded && innerTreeRowData.display);
if (typeof cur.loaded === 'boolean' && cur.loaded) {
innerTreeRowData.noLazyChildren = !(cur.children && cur.children.length);
}
if (typeof cur.lazy === 'boolean') {
if (typeof cur.loaded === 'boolean' && cur.loaded) {
innerTreeRowData.noLazyChildren = !(cur.children && cur.children.length);
}
innerTreeRowData.loading = cur.loading;
}
}
Expand Down

0 comments on commit 6fb0d57

Please sign in to comment.