-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
Data echo after lazy loading of [Bug Report] tree component selection #17549
Comments
Translation of this issue: Element UI version2.11.1 OS/Browsers versionWin 10 Vue version2.6.10 Reproduction LinkHttps://jsfiddle.net/wtrvx13z/1/ Steps to reproduceHttps://jsfiddle.net/x47j0dr6/The case can only be used when the asynchronous operation in load has been completed, and then check-back setting with setCheckedKeys. The common lazy loading situation in business is that the asynchronous operation in load may be completed at an unpredictable time, and also initialize the expansion that needs to be started. The setCheckedKeys function can not be called at this time. As long as setCheckedKeys is not invoked after all load asynchronous operations are completed, there may still be problems. Example code: https://jsfiddle.net/wtrvx13z/1/ How do you recommend to deal with this situation? What is Expected?Selecting lazy loaded tree can be correctly displayed, without considering the completion time of load function after using setCheckedNodes What is actually happening?SetCheckedNodes must be guaranteed to run properly after the load has been executed, otherwise problems will arise. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Element UI version
2.11.1
OS/Browsers version
win 10
Vue version
2.6.10
Reproduction Link
https://jsfiddle.net/wtrvx13z/1/
Steps to reproduce
https://jsfiddle.net/x47j0dr6/ 案例中的情况只能用于load中的异步操作已经执行完毕,然后再用setCheckedKeys 进行勾选回显设置,业务中常见的懒加载情况为,load中的异步操作可能在不可预知的时间执行完毕,也初始化需要展开的展开项目为多个,load会多次执行,这个时候没法确定什么时间调用setCheckedKeys函数,只要setCheckedKeys不是在所有load异步操作结束之后调用的,就可能依然有问题
示例代码:https://jsfiddle.net/wtrvx13z/1/
相关问题:#13349 #14847
请问这种情况推荐如何处理
What is Expected?
选择懒加载的tree可以正确进行回显,使用setCheckedNodes后不用考虑load函数的执行完毕时间
What is actually happening?
setCheckedNodes必须保证在load执行完毕之后才能正常运行,否则会出现问题
The text was updated successfully, but these errors were encountered: