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

tree组件设置defaultExpandAll 异步获取值的情况下不会自动展开所有节点 #21

Closed
1 task done
ZeroJsus opened this issue May 16, 2018 · 3 comments
Closed
1 task done

Comments

@ZeroJsus
Copy link

ZeroJsus commented May 16, 2018

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

Version

...0.5.1

Environment

...vue2.5.2

Reproduction link

example

Steps to reproduce

...1.设置a-tree标签
2.默认的treeNodes值设置为空数组
3.在mounted组件加载的时候给treeNodes的值赋值

What is expected?

... 应该是只有第一次获取值不是空的才能正确展开全部节点

@tangjinzhou
Copy link
Member

defaultExpandAll 仅在组件第一次渲染时有效,不仅仅tree组件,其它组件的defaultXXX值都是这个行为,
可以自行搜索受控组件/非受控组件的概念。
如果你想异步获取数据后展开全部结点,可以使用非受控方式,或这种方式

@ZeroJsus
Copy link
Author

谢谢你 你给的例子完美的解决了我的问题

@lock
Copy link

lock bot commented May 17, 2019

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants