Open liushangdev opened 4 years ago
Translation of this issue:
2.13.2
Windows 7 / Google Chrome 71.0.3578.98 (official version) (64 bit)
2.6.11
https://codepen.io/liushangdev/pen/oNbZyNb
By listening to the row click event, click the unexpanded row to expand it. Click again to close it. Expand row keys has been set to empty
You can expand and close by clicking the event control line
Can only expand, can't close
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.
逻辑应该在tree.js文件的getExpanded方法,在给expandRowKeys赋值为空的情况下,由于展开后旧值的expanded属性是true,所以就算included是false,所以getExpanded返回的结果也是true,就导致就算expandRowKeys为空,新值的expanded也是true
@klren0312 请问在只有row-key的情况下(如何通过row-key获取row?)如何调用此方法
@klren0312 请问在只有row-key的情况下(如何通过row-key获取row?)如何调用此方法
tableData.find(row => row[row-key] === row-key)
Element UI version
2.13.2
OS/Browsers version
Windows7/Google Chrome 71.0.3578.98(正式版本) (64 位)
Vue version
2.6.11
Reproduction Link
https://codepen.io/liushangdev/pen/oNbZyNb
Steps to reproduce
通过监听行单击事件,点击未展开的行,可以展开,再次点击无法关闭,expand-row-keys已置为空
What is Expected?
可以通过单击事件 控制行展开,关闭
What is actually happening?
只能展开,不能关闭