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 Debug from '@/views/Debug.vue'
|
||||||
import Login from '@/views/Login.vue'
|
import Login from '@/views/Login.vue'
|
||||||
import { useAuthStore } from '@/stores/AuthStore'
|
import { useAuthStore } from '@/stores/AuthStore'
|
||||||
|
import { nextTick } from 'vue'
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory(import.meta.env.BASE_URL),
|
history: createWebHistory(import.meta.env.BASE_URL),
|
||||||
@@ -11,16 +12,25 @@ const router = createRouter({
|
|||||||
path: '/',
|
path: '/',
|
||||||
name: 'login',
|
name: 'login',
|
||||||
component: Login,
|
component: Login,
|
||||||
|
meta: {
|
||||||
|
title: 'GohCMS - Connexion'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/debug',
|
path: '/debug',
|
||||||
name: 'debug',
|
name: 'debug',
|
||||||
component: Debug
|
component: Debug,
|
||||||
|
meta: {
|
||||||
|
title: 'GohCMS - Debug'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/home',
|
path: '/home',
|
||||||
name: '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
|
export default router
|
||||||
|
|||||||
Reference in New Issue
Block a user