mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 11:43:22 +02:00
Added pages titles
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user