mirror of
https://github.com/Lissy93/dashy.git
synced 2024-12-23 08:52:28 +03:00
✨ Show links to other pages in the navbar
This commit is contained in:
parent
b4e2c42bda
commit
9d43f013dc
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<header>
|
||||
<PageTitle v-if="titleVisible" :title="pageInfo.title" :description="pageInfo.description" />
|
||||
<Nav v-if="navVisible" :links="pageInfo.navLinks" class="nav" />
|
||||
<Nav v-if="navVisible" :links="getNavLinks()" class="nav" />
|
||||
</header>
|
||||
</template>
|
||||
|
||||
@ -12,6 +12,7 @@ import { visibleComponents } from '@/utils/defaults';
|
||||
|
||||
export default {
|
||||
name: 'Header',
|
||||
inject: ['config'],
|
||||
components: {
|
||||
PageTitle,
|
||||
Nav,
|
||||
@ -26,6 +27,19 @@ export default {
|
||||
navVisible: visibleComponents.navigation,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
getNavLinks() {
|
||||
const { appConfig } = this.config;
|
||||
const pageLinks = [];
|
||||
if (appConfig.additionalConfigFiles) {
|
||||
appConfig.additionalConfigFiles.forEach((pageLink) => {
|
||||
const name = pageLink.split('.')[0];
|
||||
pageLinks.push({ title: name, path: `/home/${name}` });
|
||||
});
|
||||
}
|
||||
return pageLinks.concat(this.pageInfo.navLinks);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user