You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
是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)
}
}
}
The text was updated successfully, but these errors were encountered:
1、节点属性多并且节点个数多时


会报内存溢出的问题
是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)
}
}
}
The text was updated successfully, but these errors were encountered: