diff --git a/web/admin-gui/src/router/index.ts b/web/admin-gui/src/router/index.ts index cacb985..cb7ddd6 100644 --- a/web/admin-gui/src/router/index.ts +++ b/web/admin-gui/src/router/index.ts @@ -3,6 +3,7 @@ import Home from '@/views/Home.vue' import Debug from '@/views/Debug.vue' import Login from '@/views/Login.vue' import { useAuthStore } from '@/stores/AuthStore' +import { nextTick } from 'vue' const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), @@ -11,16 +12,25 @@ const router = createRouter({ path: '/', name: 'login', component: Login, + meta: { + title: 'GohCMS - Connexion' + } }, { path: '/debug', name: 'debug', - component: Debug + component: Debug, + meta: { + title: 'GohCMS - Debug' + } }, { path: '/home', name: 'home', - component: Home + component: Home, + meta: { + title: 'GohCMS - Accueil' + } }, ] }) @@ -40,4 +50,10 @@ router.beforeEach(async (to, from) => { } }) +router.afterEach((to, from) => { + nextTick(() => { + document.title = to.meta.title as string ?? 'GohCMS' + }) +}) + export default router