Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The [Bug Report] el-tree component opens the lazy and check-strictly options. If the default-checked-keys is not empty, the state of the father child node or the correlation between them. #12056

Closed
Jack-X-Yang opened this issue Jul 19, 2018 · 3 comments

Comments

@Jack-X-Yang
Copy link

Element UI version

2.4.4

OS/Browsers version

mac 10.13.5 / Chrome 67

Vue version

2.5.17-beta.0

Reproduction Link

https://jsfiddle.net/mmx38qxw/3898/

Steps to reproduce

el-tree 组件开启 lazy 和 check-strictly 选项,default-checked-keys 不为空。如果父结点未被选中,子结点在 default-checked-keys 中,展开父结点,父结点会被选中。

What is Expected?

父子结点的选中状态不关联

What is actually happening?

父子结点的选中状态关联

@element-bot element-bot changed the title [Bug Report] el-tree 组件开启 lazy 和 check-strictly 选项,default-checked-keys 不为空时父子结点的状态还是关联 The [Bug Report] el-tree component opens the lazy and check-strictly options. If the default-checked-keys is not empty, the state of the father child node or the correlation between them. Jul 19, 2018
@element-bot
Copy link
Member

Translation of this issue:

Element UI version
2.4.4

OS/Browsers version
Mac 10.13.5 / Chrome 67

Vue version
2.5.17-beta.0

Reproduction Link
https://jsfiddle.net/mmx38qxw/3898/

Steps to reproduce
The el-tree component opens the lazy and check-strictly options, and default-checked-keys is not empty. If the parent node is not selected and the child node is in default-checked-keys, the parent node is expanded, and the parent node is selected.

What is Expected?
The selected state of the parent and child node is not related

What is actually happening?
Selected state association of father and child node

@Jack-X-Yang
Copy link
Author

解决方法:

https://github.com/ElemeFE/element/blob/dev/packages/tree/src/model/node.js#L318

reInitChecked(this);

改为

if (!this.store.checkStrictly) {
  reInitChecked(this);
}

@ziyoung
Copy link
Contributor

ziyoung commented Jul 20, 2018

@Jack-X-Yang 链接打开后,无法正常渲染。重新编辑了一下:https://jsfiddle.net/zhiyang/mmx38qxw/3931/
欢迎来提 pr。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants