Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Element
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林焕东
Element
Commits
70f63842
Commit
70f63842
authored
Aug 29, 2019
by
hetech
Committed by
GitHub
Aug 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Table: fix expand-row-keys not work when data is loaded asynchronously (#16899)
parent
eddf8527
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
packages/table/src/store/tree.js
packages/table/src/store/tree.js
+4
-8
No files found.
packages/table/src/store/tree.js
View file @
70f63842
...
@@ -5,7 +5,8 @@ export default {
...
@@ -5,7 +5,8 @@ export default {
return
{
return
{
states
:
{
states
:
{
// defaultExpandAll 存在于 expand.js 中,这里不重复添加
// defaultExpandAll 存在于 expand.js 中,这里不重复添加
// TODO: 拆分为独立的 TreeTale,在 expand 中,展开行的记录是放在 expandRows 中,统一用法
// 在展开行中,expandRowKeys 会被转化成 expandRows,expandRowKeys 这个属性只是记录了 TreeTable 行的展开
// TODO: 拆分为独立的 TreeTable,统一用法
expandRowKeys
:
[],
expandRowKeys
:
[],
treeData
:
{},
treeData
:
{},
indent
:
16
,
indent
:
16
,
...
@@ -52,8 +53,6 @@ export default {
...
@@ -52,8 +53,6 @@ export default {
watch
:
{
watch
:
{
normalizedData
:
'
updateTreeData
'
,
normalizedData
:
'
updateTreeData
'
,
// expandRowKeys 在 TreeTable 中也有使用
expandRowKeys
:
'
updateTreeData
'
,
normalizedLazyNode
:
'
updateTreeData
'
normalizedLazyNode
:
'
updateTreeData
'
},
},
...
@@ -153,11 +152,8 @@ export default {
...
@@ -153,11 +152,8 @@ export default {
},
},
updateTreeExpandKeys
(
value
)
{
updateTreeExpandKeys
(
value
)
{
// 仅仅在包含嵌套数据时才去更新
this
.
states
.
expandRowKeys
=
value
;
if
(
Object
.
keys
(
this
.
normalizedData
).
length
)
{
this
.
updateTreeData
();
this
.
states
.
expandRowKeys
=
value
;
this
.
updateTreeData
();
}
},
},
toggleTreeExpansion
(
row
,
expanded
)
{
toggleTreeExpansion
(
row
,
expanded
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment