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() {
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;
}
},
},
};
</script>