mirror of https://github.com/ElemeFE/element
Tree: Modify loop conditions to improve performance (#15699)
parent
d274358dcc
commit
1b8e3d823b
|
@ -44,10 +44,7 @@ export default class TreeStore {
|
||||||
|
|
||||||
if (!node.visible && childNodes.length) {
|
if (!node.visible && childNodes.length) {
|
||||||
let allHidden = true;
|
let allHidden = true;
|
||||||
|
allHidden = !childNodes.some(child => child.visible);
|
||||||
childNodes.forEach((child) => {
|
|
||||||
if (child.visible) allHidden = false;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (node.root) {
|
if (node.root) {
|
||||||
node.root.visible = allHidden === false;
|
node.root.visible = allHidden === false;
|
||||||
|
|
Loading…
Reference in New Issue