From dc1df2b6d82a6ccb84b989701943052ce175db39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81rmin=20Scipiades?= Date: Tue, 27 Jul 2021 11:52:59 +0200 Subject: [PATCH] Highlight active item in the navbar Solves part of #39 --- src/index.ts | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/src/index.ts b/src/index.ts index 63bed56..02c07de 100644 --- a/src/index.ts +++ b/src/index.ts @@ -53,23 +53,26 @@ if (process.env.NODE_ENV !== 'production') { const auth = getAuth(firebaseApp) auth.useDeviceLanguage() -const router = new VueRouter({ routes: [ - { path: '/info', component: InfoPage }, - { path: '/privacy', component: PrivacyPage }, - { path: '/settings', component: SettingsPage }, - { - path: '/(rides|bikes|stations|time)?', - component: StatPage, - children: [ - { path: '/rides', component: BubiRides }, - { path: '/bikes', component: Bikes }, - { path: '/stations', component: StationsPage }, - { path: '/time', component: TimePage }, - { path: '/', component: BubiRides } - ] - }, - { path: '*', component: NotFoundPage }, -]}) +const router = new VueRouter({ + linkActiveClass: 'is-active', + routes: [ + { path: '/info', component: InfoPage }, + { path: '/privacy', component: PrivacyPage }, + { path: '/settings', component: SettingsPage }, + { + path: '/(rides|bikes|stations|time)?', + component: StatPage, + children: [ + { path: '/rides', component: BubiRides }, + { path: '/bikes', component: Bikes }, + { path: '/stations', component: StationsPage }, + { path: '/time', component: TimePage }, + { path: '/', component: BubiRides } + ] + }, + { path: '*', component: NotFoundPage } + ] +}) new Vue({ el: '#app',