[bug report] after the El tree component performs filtering, selecting the parent will also select the data outside the filtering
Element UI version
2.15.6
OS/Browsers version
OS:win10 Browser:Chrome版本 96.0.4664.9(正式版本)dev (64 位)
Vue version
2.6.11
Reproduction Link
https://codepen.io/wisenchen/pen/GRvZrzL
Steps to reproduce
- 输入 11
- 点击搜索
- 勾选“p1" 或者 “root”
- 点击 “reset”
- 发现选中了p1下的所有子节点,即会选中除筛选结果外其他的节点
What is Expected?
- 在筛选状态下,选中父级也只会选中筛选结果的节点;
- 或者能否提供一个配置项?用途为只选中可见节点;
另外我发现在/tree/src/model/node.js文件setChecked方法加一个visible === true的判断即可达到我目前的需求,如果这是个问题我能否提个PR
What is actually happening?
选中父级时会把未显示的子节点选中
Translation of this issue:
Element UI version
2.15.6
OS/Browsers version
OS: win10 browser: Chrome version 96.0.4664.9 (official version) dev (64 bit)
Vue version
2.6.11
Reproduction Link
https://codepen.io/wisenchen/pen/GRvZrzL
Steps to reproduce
-
Enter 11
-
Click search
-
Check "P1" or "root"
-
Click "reset"
-
If all child nodes under P1 are selected, nodes other than the filter results will be selected
What is Expected?
-
In filtering status, selecting a parent will only select nodes with filtering results;
-
Or can you provide a configuration item? The purpose is to select only visible nodes; In addition, I found that adding a judgment of visible = = = true to the setchecked method in the / tree / SRC / model / node.js file can meet my current requirements. If this is a problem, can I ask PR
What is actually happening?
When the parent is selected, the child nodes that are not displayed will be selected
请问下这个是解决了吗?目前2.15.10使用还是勾选父节点的时候会选中visible为false的节点
这是什么意思?没有结果了吗?
使用props把visible为false的节点禁用试试
:props="{ isabled: (data, node) => !node.visible }"