0
0
Fork 0

fix(ZoneCard): fix ZoneLocations redirections

This commit is contained in:
Alex Moreno 2024-11-14 13:59:04 +01:00
parent a929dec2ab
commit 045a828bf9
1 changed files with 11 additions and 11 deletions

View File

@ -42,16 +42,15 @@ const arrayData = useArrayData(datakey, {
const { store } = arrayData;
const storeData = computed(() => store.data);
const nodes = ref([
{
id: null,
name: props.rootLabel,
sons: true,
tickable: false,
noTick: true,
children: [{}],
},
]);
const defaultNode = {
id: null,
name: props.rootLabel,
sons: true,
tickable: false,
noTick: true,
children: [{}],
};
const nodes = ref([defaultNode]);
const _tickedNodes = computed({
get: () => props.tickedNodes,
@ -131,6 +130,7 @@ function getNodeIds(node) {
watch(storeData, async (val) => {
// Se triggerea cuando se actualiza el store.data, el cual es el resultado del fetch de la searchbar
if (!nodes.value[0]) nodes.value = [defaultNode];
nodes.value[0].childs = [...val];
const fetchedNodeKeys = val.flatMap(getNodeIds);
state.set('Tree', [...fetchedNodeKeys]);
@ -196,7 +196,7 @@ onUnmounted(() => {
<QBtn color="primary" icon="search" dense flat @click="reFetch()" />
</template>
</VnInput>
<VnSearchbar :data-key="datakey" :url="url" :redirect="false"/>
<VnSearchbar :data-key="datakey" :url="url" :redirect="false" />
<QTree
ref="treeRef"
:nodes="nodes"