From 8d4513d79c5726fe6defb26bcfb48d9cc0626e6b Mon Sep 17 00:00:00 2001 From: tobinio Date: Sun, 20 Oct 2024 11:31:29 +0200 Subject: [PATCH] make sidebar open & closeable --- app/components/filter/Item.vue | 10 ++++++---- app/pages/charts.vue | 19 ++++++++++++++++--- bun.lockb | Bin 392706 -> 395294 bytes nuxt.config.ts | 7 ++++++- package.json | 1 + 5 files changed, 29 insertions(+), 8 deletions(-) diff --git a/app/components/filter/Item.vue b/app/components/filter/Item.vue index c100e67..a434f5c 100644 --- a/app/components/filter/Item.vue +++ b/app/components/filter/Item.vue @@ -26,11 +26,13 @@ function onSelect(option: string) {
- +
+ +
-
diff --git a/app/pages/charts.vue b/app/pages/charts.vue index 293ecda..43e9e87 100644 --- a/app/pages/charts.vue +++ b/app/pages/charts.vue @@ -58,12 +58,25 @@ const { data } = useFetch(url, { const explanation = computed(() => { return useExplanations(stat.value); }); + +const sidebarVisible = ref(false); + +onMounted(() => { + const isMediumScreen = useMediaQuery("(min-width: 768px)"); + + if (isMediumScreen.value) { + sidebarVisible.value = true; + } +});