ElemeFE / element

A Vue.js 2.0 UI Toolkit for Web
https://element.eleme.io/
MIT License
54.13k stars 14.64k forks source link

[bug report] after the El tree component performs filtering, selecting the parent will also select the data outside the filtering #21392

Open wisenchen opened 3 years ago

wisenchen commented 3 years ago

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

  1. 输入 11
  2. 点击搜索
  3. 勾选“p1" 或者 “root”
  4. 点击 “reset”
  5. 发现选中了p1下的所有子节点,即会选中除筛选结果外其他的节点

What is Expected?

  1. 在筛选状态下,选中父级也只会选中筛选结果的节点;
  2. 或者能否提供一个配置项?用途为只选中可见节点;

另外我发现在/tree/src/model/node.js文件setChecked方法加一个visible === true的判断即可达到我目前的需求,如果这是个问题我能否提个PR

What is actually happening?

选中父级时会把未显示的子节点选中

element-bot commented 3 years ago

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

  1. Enter 11

  2. Click search

  3. Check \"P1\" or \"root\"

  4. Click \"reset\"

  5. If all child nodes under P1 are selected, nodes other than the filter results will be selected

What is Expected?

  1. In filtering status, selecting a parent will only select nodes with filtering results;

  2. 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

ZhangWafer commented 2 years ago

请问下这个是解决了吗?目前2.15.10使用还是勾选父节点的时候会选中visible为false的节点

wang21chun commented 1 year ago

这是什么意思?没有结果了吗?