0
0
Fork 0

feat: refs #8242 use stateStore

This commit is contained in:
Javier Segarra 2025-02-26 10:40:17 +01:00
parent 1c4b5aa720
commit 82faba62ca
2 changed files with 15 additions and 3 deletions

View File

@ -12,7 +12,7 @@ const $props = defineProps({
},
});
onMounted(
() => (stateStore.leftDrawer = useQuasar().screen.gt.xs ? $props.leftDrawer : false)
() => (stateStore.leftDrawer = useQuasar().screen.gt.xs ? $props.leftDrawer : false),
);
const teleportRef = ref({});
@ -35,8 +35,14 @@ onMounted(() => {
<template>
<QDrawer v-model="stateStore.leftDrawer" show-if-above :width="256">
<QScrollArea class="fit text-grey-8">
<div id="left-panel" ref="teleportRef"></div>
<LeftMenu v-if="!hasContent" />
<div id="left-panel" ref="teleportRef">
<template v-if="stateStore.cardDescriptor">
<component :is="stateStore.cardDescriptor" />
<QSeparator />
<LeftMenu source="card" />
</template>
<template v-else> <LeftMenu /></template>
</div>
</QScrollArea>
</QDrawer>
<QPageContainer>

View File

@ -7,7 +7,11 @@ export const useStateStore = defineStore('stateStore', () => {
const rightDrawer = ref(false);
const rightAdvancedDrawer = ref(false);
const subToolbar = ref(false);
const cardDescriptor = ref(null);
function cardDescriptorChangeValue(descriptor) {
cardDescriptor.value = descriptor;
}
function toggleLeftDrawer() {
leftDrawer.value = !leftDrawer.value;
}
@ -49,6 +53,8 @@ export const useStateStore = defineStore('stateStore', () => {
}
return {
cardDescriptor,
cardDescriptorChangeValue,
leftDrawer,
rightDrawer,
rightAdvancedDrawer,