mirror of
https://github.com/Lissy93/dashy.git
synced 2026-01-25 17:21:59 +01:00
fix(nav): move v-for key to rendered elements and fix indentation
This commit is contained in:
parent
012e50f275
commit
73f5a85506
1 changed files with 4 additions and 2 deletions
|
|
@ -6,14 +6,16 @@
|
|||
/>
|
||||
<nav id="nav" v-if="navVisible">
|
||||
<!-- Render either router-link or anchor, depending if internal / external link -->
|
||||
<template v-for="(link, index) in allLinks" :key="index">
|
||||
<template v-for="(link, index) in allLinks">
|
||||
<router-link
|
||||
v-if="!isUrl(link.path)"
|
||||
:key="index"
|
||||
:to="link.path"
|
||||
:class="['nav-item', link._isHome ? 'home-button' : '']"
|
||||
>{{ link.title }}</router-link>
|
||||
<a
|
||||
v-else
|
||||
:key="index"
|
||||
:href="link.path"
|
||||
:target="determineTarget(link)"
|
||||
:class="['nav-item', link._isHome ? 'home-button' : '']"
|
||||
|
|
@ -56,7 +58,7 @@ export default {
|
|||
subPages = subPages.filter(p => !p.path.endsWith(`/${currentSubPageId}`));
|
||||
}
|
||||
const navLinks = this.links || [];
|
||||
const homeButton = currentSubPageId ? [{ path: '/home/', title: 'Home', _isHome: true }] : [];
|
||||
const homeButton = currentSubPageId ? [{ path: '/home/', title: 'Home', _isHome: true }] : [];
|
||||
return [...navLinks, ...subPages, ...homeButton];
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue