forked from verdnatura/salix-front
feat: refs #8242 use stateStore
This commit is contained in:
parent
1c4b5aa720
commit
82faba62ca
|
@ -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>
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue