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) {
|
||||
let allHidden = true;
|
||||
|
||||
childNodes.forEach((child) => {
|
||||
if (child.visible) allHidden = false;
|
||||
});
|
||||
allHidden = !childNodes.some(child => child.visible);
|
||||
|
||||
if (node.root) {
|
||||
node.root.visible = allHidden === false;
|
||||
|
|
Loading…
Reference in New Issue