From 2fc411d51dfddc5bce9817b5a84131b26c0bff44 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] [UI] Show menu drawer if on desktop --- src/layouts/MainLayout.vue | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index d2d148e..1bf641b 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,19 @@ 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) { + return _leftDrawer.value + } + if (Platform.is.mobile) { + return false + } + return true + }, + set: (val) => _leftDrawer.value = val + }) const leftDrawerMini = ref(false); const mainLinks = flaschengeist?.menuLinks || []; const notifications = computed(() => mainStore.notifications.slice().reverse());