Skip to content

当节点属性过多时,使用懒加载加载大数据量时,smoothTree方法会内存溢出 #59

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

Open
wodehaochide opened this issue Mar 24, 2025 · 0 comments

Comments

@wodehaochide
Copy link

1、节点属性多并且节点个数多时
Image
会报内存溢出的问题
Image

是smooth方法中reduce导致的,改成下面这种效果可能要好一点。
smoothTree(treeData, array) {
for (const data of treeData) {
if (data.visible) {
// Mark different types to avoid being optimized out when assembled into the same dom
data.type = this.showCheckbox
? ${data.level}-${data.checked}-${data.indeterminate}
: ${data.level}-${data.expanded};
array.push(data);
}
if (data.expanded && data.childNodes.length) {
this.smoothTree(data.childNodes, array)
}
}
}

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

No branches or pull requests

1 participant