From 206e297576f8cecaf1101b283140174a5c9ebf0e Mon Sep 17 00:00:00 2001 From: axolotle Date: Wed, 10 Mar 2021 18:37:06 +0100 Subject: [PATCH] add active state to route links --- src/App.vue | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/src/App.vue b/src/App.vue index 0138c1d..eaa3506 100644 --- a/src/App.vue +++ b/src/App.vue @@ -8,17 +8,8 @@ Menu - - {{ $t('sections.home') }} - - - {{ $t('sections.introduction') }} - - - {{ $t('sections.blog') }} - - - {{ $t('sections.contact') }} + + {{ $t('sections.' + name) }} @@ -26,15 +17,12 @@ {{ $t('title') }} - - - {{ $t('sections.library') }} - - - {{ $t('sections.kit') }} - - - {{ $t('sections.gallery') }} + + + {{ $t('sections.' + name) }} @@ -59,6 +47,13 @@ export default { // all titles will be injected into this template titleTemplate: '%s | ' + this.$t('title') } + }, + + data () { + return { + mainRoutes: ['library', 'kit', 'gallery'], + subRoutes: ['home', 'introduction', 'blog', 'contact'] + } } }