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

Some questions about the a-directory-tree component #4958

Closed
1 task done
jaycethanks opened this issue Dec 1, 2021 · 2 comments
Closed
1 task done

Some questions about the a-directory-tree component #4958

jaycethanks opened this issue Dec 1, 2021 · 2 comments
Labels

Comments

@jaycethanks
Copy link

jaycethanks commented Dec 1, 2021

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

1.7.4

Environment

os : windows 20H2, chrome: 96.0.4664.45 vue:2.6.14

Reproduction link

Edit on CodeSandbox

Steps to reproduce

问题3 的复现可以搜索关键字“jayce”测试

What is expected?

问题1: ----> 正常全部展开
问题2: ----> 都能折叠展开
问题3: ----> 父级目录的折叠不受子目录影响

What is actually happening?

问题1: 设定了default-expand-all ,但是默认不会展开全部;
问题2: 点击文件夹icon 能够折叠展开,但是点击三角icon 不能折叠展开; 并且有发现别的实现中存在相反的情况;
问题3: 如果存在未折叠的子目录,那么父目录也无法折叠; (这个问题好像是偶发的)


问题3的尝试解决: 因为需要通过搜索,找到匹配项后自动展开,也就是autoExpandParent 需要设为true, 但是我发现这个属性会引发这个以上描述的问题。

  1. 我先是尝试通过搜索框的 @focus@blur 事件 去控制 autoExpandParent 取值以解决该问题。 但是也存在比较明显的问题, 如点击搜索的结果,将会失焦,然后全部自动折叠)
    该方式的复现在这里:https://codesandbox.io/s/adirectorytree-reproduce-question3-solution1-forked-9f9lj

  2. 然后我尝试手动的在折叠的时候将所有展开的子节点手动移除,看起来好像是解决了,不知道是否存在隐在问题。该方式的复现,在以上的复现链接中, 详见toggleExpandTree 方法。 但是我完成一个功能写了好多递归,希望有更好的解决方法

@tangjinzhou tangjinzhou added the 1.x version 1.x label Dec 3, 2021
@github-actions
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants