fix category sidebar hidden all the time

This commit is contained in:
hay-kot 2021-02-19 17:20:28 -09:00
commit 86652dcecb

View file

@ -37,6 +37,7 @@ export default {
data() { data() {
return { return {
showSidebar: false, showSidebar: false,
mobile: false,
links: [], links: [],
baseLinks: [ baseLinks: [
{ {
@ -56,24 +57,20 @@ export default {
allCategories() { allCategories() {
return this.$store.getters.getCategories; return this.$store.getters.getCategories;
}, },
mobile() {
switch (this.$vuetify.breakpoint.name) {
case "xs":
return true;
case "sm":
return true;
default:
return false;
}
},
}, },
watch: { watch: {
allCategories() { allCategories() {
this.buildSidebar(); this.buildSidebar();
}, },
showSidebar() {
console.log("Sidebar", this.showSidebar);
console.log("Mobile", this.mobile);
},
}, },
mounted() { mounted() {
this.buildSidebar(); this.buildSidebar();
this.mobile = this.viewScale();
this.showSidebar = !this.viewScale();
}, },
methods: { methods: {
@ -88,6 +85,16 @@ export default {
}); });
}); });
}, },
viewScale() {
switch (this.$vuetify.breakpoint.name) {
case "xs":
return true;
case "sm":
return true;
default:
return false;
}
},
}, },
}; };
</script> </script>