Move container card to parent view

This commit is contained in:
William Buezas 2024-05-26 20:57:45 -03:00
parent b4331ab2d2
commit d9e6baf7e3
2 changed files with 37 additions and 37 deletions

View File

@ -4,6 +4,8 @@ import ZoneLocationsTree from './ZoneLocationsTree.vue';
<template> <template>
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<ZoneLocationsTree /> <QCard class="full-width q-pa-md" style="max-width: 800px">
<ZoneLocationsTree />
</QCard>
</QPage> </QPage>
</template> </template>

View File

@ -144,42 +144,40 @@ onMounted(async () => {
</script> </script>
<template> <template>
<QCard class="full-width" style="max-width: 800px"> <QTree
<QTree ref="treeRef"
ref="treeRef" :nodes="nodes"
:nodes="nodes" node-key="id"
node-key="id" label-key="name"
label-key="name" v-model:expanded="expanded"
v-model:expanded="expanded" @update:expanded="onNodeExpanded($event)"
@update:expanded="onNodeExpanded($event)" :default-expand-all="true"
:default-expand-all="true" >
> <template #default-header="{ node }">
<template #default-header="{ node }"> <div
<div :id="node.id"
:id="node.id" class="qtr row justify-between full-width q-pr-md cursor-pointer"
class="qtr row justify-between full-width q-pr-md cursor-pointer" >
> <span v-if="!node.id">{{ node.name }}</span>
<span v-if="!node.id">{{ node.name }}</span> <QCheckbox
<QCheckbox v-else
v-else v-model="node.selected"
v-model="node.selected" :label="node.name"
:label="node.name" @update:model-value="($event) => onSelected($event, node)"
@update:model-value="($event) => onSelected($event, node)" toggle-indeterminate
toggle-indeterminate color="transparent"
color="transparent" :class="[
:class="[ 'checkbox',
'checkbox', node.selected
node.selected ? '--checked'
? '--checked' : node.selected == false
: node.selected == false ? '--unchecked'
? '--unchecked' : '--indeterminate',
: '--indeterminate', ]"
]" />
/> </div>
</div> </template>
</template> </QTree>
</QTree>
</QCard>
</template> </template>
<style lang="scss"> <style lang="scss">