Skip to content

能否增加清空某个节点的函数。 #97

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

Closed
xtuer opened this issue Jul 5, 2024 · 3 comments · Fixed by #102
Closed

能否增加清空某个节点的函数。 #97

xtuer opened this issue Jul 5, 2024 · 3 comments · Fixed by #102

Comments

@xtuer
Copy link

xtuer commented Jul 5, 2024

问题描述
能否增加清空某个节点的函数。
要清空某个节点,目前使用已经提供的 API treeRef.value. remove(nodeId) 在 for 循环里逐个删除,数据量小的时候问题不大,数据量几万后界面会卡住几十秒。

目前暂时的解决办法是把要清空的节点从它的 parent 里删除,然后重建一个同样的节点。

组件版本

  • Vue3
  • @wsfe/vue-tree
@ChuChencheng
Copy link
Collaborator

清空节点是指移除节点的所有子节点?

@xtuer
Copy link
Author

xtuer commented Jul 6, 2024

清空节点是指移除节点的所有子节点?

是的。

@ChuChencheng
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants