Element UI version
2.13.0
OS/Browsers version
macOS 10.14.3 / chrome 版本 80.0.3987.132
Vue version
3.0.0-alpha.7
Reproduction Link
https://codepen.io/xiaobeizi/pen/RwPjbqK?editable=true
Steps to reproduce
At first set the expand-row-keys to ['3'],after 3 seconds reassign the expand-row-keys to ['1']
What is Expected?
only row['1'] is expanded
What is actually happening?
both row['3'] and row['1'] are expanded
5条答案
按热度按时间ryoqjall1#
Translation of this issue:
Element UI version
2.13.0
OS/Browsers version
Mac OS 10.14.3 / Chrome version 80.0.3987.132
Vue version
3.0.0-alpha.7
Reproduction Link
https://codepen.io/xiaobeizi/pen/RwPjbqK?editable=true
Steps to reproduce
At first set the expand-row-keys to ['3'],after 3 seconds reassign the expand-row-keys to ['1']
What is Expected?
only row['1'] is expanded
What is actually happening?
both row['3'] and row['1'] are expanded
4xy9mtcn2#
2.13.1也是这样, 只能展开 无法闭合
sd2nnvve3#
same problem
jm2pwxwz4#
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
vktxenjb5#
same problem, but it worked after re-render. I use v-if='isRerender' to the table (isRerender default value with true) and in the expand-change method only when there are values in the expand-row-keys to use isRerender to let the table rerender then it worked:
code like:
handleExpandChange(row, expand) {
......
if(expand) {
if(expandRowKeys.length){
isRerender = false
this.$nextTick(()=>{
......
isRerender = true
})
}
}
......
}