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() {
|
mounted() {
|
||||||
this.buildSidebar();
|
this.buildSidebar();
|
||||||
this.mobile = this.viewScale();
|
this.mobile = this.viewScale();
|
||||||
@ -81,14 +70,27 @@ export default {
|
|||||||
this.links = [];
|
this.links = [];
|
||||||
this.links.push(...this.baseLinks);
|
this.links.push(...this.baseLinks);
|
||||||
const pages = await api.siteSettings.getPages();
|
const pages = await api.siteSettings.getPages();
|
||||||
pages.sort((a, b) => a.position - b.position);
|
if(pages.length > 0) {
|
||||||
pages.forEach(async element => {
|
pages.sort((a, b) => a.position - b.position);
|
||||||
this.links.push({
|
pages.forEach(async element => {
|
||||||
title: element.name,
|
this.links.push({
|
||||||
to: `/pages/${element.slug}`,
|
title: element.name,
|
||||||
icon: "mdi-tag",
|
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() {
|
viewScale() {
|
||||||
switch (this.$vuetify.breakpoint.name) {
|
switch (this.$vuetify.breakpoint.name) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user