From 86652dcecbeca9b60dd68bbeda30b45eecfad459 Mon Sep 17 00:00:00 2001 From: hay-kot Date: Fri, 19 Feb 2021 17:20:28 -0900 Subject: [PATCH] fix category sidebar hidden all the time --- .../src/components/UI/CategorySidebar.vue | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/frontend/src/components/UI/CategorySidebar.vue b/frontend/src/components/UI/CategorySidebar.vue index 7b71458d4..1d2c7b4bd 100644 --- a/frontend/src/components/UI/CategorySidebar.vue +++ b/frontend/src/components/UI/CategorySidebar.vue @@ -37,6 +37,7 @@ export default { data() { return { showSidebar: false, + mobile: false, links: [], baseLinks: [ { @@ -56,24 +57,20 @@ export default { allCategories() { return this.$store.getters.getCategories; }, - mobile() { - switch (this.$vuetify.breakpoint.name) { - case "xs": - return true; - case "sm": - return true; - default: - return false; - } - }, }, watch: { allCategories() { this.buildSidebar(); }, + showSidebar() { + console.log("Sidebar", this.showSidebar); + console.log("Mobile", this.mobile); + }, }, mounted() { this.buildSidebar(); + this.mobile = this.viewScale(); + this.showSidebar = !this.viewScale(); }, methods: { @@ -88,6 +85,16 @@ export default { }); }); }, + viewScale() { + switch (this.$vuetify.breakpoint.name) { + case "xs": + return true; + case "sm": + return true; + default: + return false; + } + }, }, };