forked from verdnatura/salix-front
perf: remove local tree variable
This commit is contained in:
parent
f4807d887f
commit
3fded533a6
|
@ -99,14 +99,13 @@ watch(storeData, async (val) => {
|
||||||
nodes.value[0].children = [...val];
|
nodes.value[0].children = [...val];
|
||||||
const fetchedNodeKeys = val.flatMap(getNodeIds);
|
const fetchedNodeKeys = val.flatMap(getNodeIds);
|
||||||
state.set('Tree', [...fetchedNodeKeys]);
|
state.set('Tree', [...fetchedNodeKeys]);
|
||||||
const tree = state.get('Tree');
|
for (let n of state.get('Tree')) {
|
||||||
for (let n of tree) {
|
|
||||||
await fetchNodeLeaves(n);
|
await fetchNodeLeaves(n);
|
||||||
}
|
}
|
||||||
expanded.value = [null, 1, ...fetchedNodeKeys];
|
expanded.value = [null, 1, ...fetchedNodeKeys];
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(async (n) => {
|
onMounted(async () => {
|
||||||
const tree = [...state.get('Tree'), 1];
|
const tree = [...state.get('Tree'), 1];
|
||||||
const lastStateTree = state.get('TreeState');
|
const lastStateTree = state.get('TreeState');
|
||||||
if (tree) {
|
if (tree) {
|
||||||
|
|
Loading…
Reference in New Issue