mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-09 03:04:54 -04:00
parent
b726c9a886
commit
2c3fa81227
@ -59,17 +59,6 @@ export default {
|
||||
],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
allCategories() {
|
||||
return this.$store.getters.getCategories;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
allCategories() {
|
||||
this.buildSidebar();
|
||||
},
|
||||
showSidebar() {},
|
||||
},
|
||||
mounted() {
|
||||
this.buildSidebar();
|
||||
this.mobile = this.viewScale();
|
||||
@ -81,14 +70,27 @@ export default {
|
||||
this.links = [];
|
||||
this.links.push(...this.baseLinks);
|
||||
const pages = await api.siteSettings.getPages();
|
||||
pages.sort((a, b) => a.position - b.position);
|
||||
pages.forEach(async element => {
|
||||
this.links.push({
|
||||
title: element.name,
|
||||
to: `/pages/${element.slug}`,
|
||||
icon: "mdi-tag",
|
||||
if(pages.length > 0) {
|
||||
pages.sort((a, b) => a.position - b.position);
|
||||
pages.forEach(async element => {
|
||||
this.links.push({
|
||||
title: element.name,
|
||||
to: `/pages/${element.slug}`,
|
||||
icon: "mdi-tag",
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
else {
|
||||
const categories = await api.categories.getAll();
|
||||
categories.forEach(async element => {
|
||||
this.links.push({
|
||||
title: element.name,
|
||||
to: `/recipes/category/${element.slug}`,
|
||||
icon: "mdi-tag",
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
viewScale() {
|
||||
switch (this.$vuetify.breakpoint.name) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user