From e96d15bc663c336697d5dc6003d3b9a1792427ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Gr=C3=B6ger?= Date: Fri, 19 Nov 2021 23:10:56 +0100 Subject: [PATCH] [chore] show menu drawer auto if on desktop --- src/layouts/MainLayout.vue | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index d2d148e..84dd2fa 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -77,7 +77,7 @@ import EssentialLink from 'src/components/navigation/EssentialLink.vue'; import ShortcutLink from 'src/components/navigation/ShortcutLink.vue'; import Notification from 'src/components/Notification.vue'; import { defineComponent, ref, inject, computed, onBeforeMount, onBeforeUnmount } from 'vue'; -import { Screen } from 'quasar'; +import { Screen, Platform } from 'quasar'; import config from 'src/config'; import { useRouter } from 'vue-router'; import { useMainStore } from '@flaschengeist/api'; @@ -105,7 +105,22 @@ export default defineComponent({ const router = useRouter(); const mainStore = useMainStore(); const flaschengeist = inject('flaschengeist'); - const leftDrawer = ref(false); + const _leftDrawer = ref(); + const leftDrawer = computed({ + get: () => { + if (_leftDrawer.value !== undefined) { + console.log("ist undefiend") + return _leftDrawer.value + } + if (Platform.is.mobile) { + console.log("is mobile") + return false + } + console.log("is desktop") + return true + }, + set: (val) => _leftDrawer.value = val + }) const leftDrawerMini = ref(false); const mainLinks = flaschengeist?.menuLinks || []; const notifications = computed(() => mainStore.notifications.slice().reverse());