Element UI version
2.13.0
OS/Browsers version
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36
Vue version
2.6.10
Reproduction Link
https://codepen.io/51code/pen/mdyJPKW?&editable=true
Steps to reproduce
set the default-checked-keys like [2,3] or [2,3,4]
What is Expected?
nodes [2,3,4] will be checked;
What is actually happening?
nodes [2,3,4,5] will be checked;
3条答案
按热度按时间s4chpxco1#
same issue.
I think the problem is,
when loadData(image 1) is running, it create a new node,
then node init and call _initDefaultCheckedNode(image 2), but the node is not ready.
https://github.com/ElemeFE/element/blob/v2.13.0/packages/tree/src/model/node.js#L314
https://github.com/ElemeFE/element/blob/v2.13.0/packages/tree/src/model/node.js#L132
fhity93d2#
set default-checked-keys after all node expanded, work well.
5rgfhyps3#
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.