[Bug Report] element tree : the leaf nodes will be all checked when the lazy is true and this default-checked-keys is continuously

13z8s7eq  于 2022-10-23  发布在  其他
关注(0)|答案(3)|浏览(252)

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

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;

s4chpxco

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

fhity93d

fhity93d2#

set default-checked-keys after all node expanded, work well.

5rgfhyps

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.

相关问题