Fixed tree component showing nodes it shouldn't

This commit is contained in:
thepaperpilot 2021-08-30 23:14:42 -05:00
parent a63a4084cb
commit c1ab09f0fb

View file

@ -1,5 +1,6 @@
<template> <template>
<span class="row" v-for="(row, index) in rows" :key="index"> <span class="row" v-for="(row, index) in rows" :key="index">
<template v-if="index !== 'side'">
<tree-node <tree-node
v-for="(node, nodeIndex) in row" v-for="(node, nodeIndex) in row"
:key="nodeIndex" :key="nodeIndex"
@ -7,6 +8,7 @@
@show-modal="openModal" @show-modal="openModal"
:append="append" :append="append"
/> />
</template>
</span> </span>
<span class="side-nodes" v-if="rows.side"> <span class="side-nodes" v-if="rows.side">
<tree-node <tree-node
@ -65,7 +67,7 @@ export default defineComponent({
} }
if (layers[curr].position != undefined) { if (layers[curr].position != undefined) {
acc[layers[curr].displayRow][layers[curr].position!] = curr; acc[layers[curr].displayRow][layers[curr].position!] = curr;
} else { } else if (layers[curr].displayRow) {
acc[layers[curr].displayRow].push(curr); acc[layers[curr].displayRow].push(curr);
} }
return acc; return acc;