forked from DebaucheryLibrarian/traxxx
Added page title function for Composition API components.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router';
|
||||
|
||||
import setPageTitle from './set-page-title';
|
||||
|
||||
import Home from '../components/home/home.vue';
|
||||
import Login from '../components/auth/login.vue';
|
||||
import Signup from '../components/auth/signup.vue';
|
||||
@@ -257,11 +259,17 @@ const routes = [
|
||||
path: '/stats',
|
||||
component: Stats,
|
||||
name: 'stats',
|
||||
meta: {
|
||||
title: 'Stats',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/not-found',
|
||||
name: 'not-found',
|
||||
component: NotFound,
|
||||
meta: {
|
||||
title: 'Not Found',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/:catchAll(.*)',
|
||||
@@ -276,4 +284,6 @@ const router = createRouter({
|
||||
routes,
|
||||
});
|
||||
|
||||
router.beforeEach((to) => setPageTitle(to.meta.title));
|
||||
|
||||
export default router;
|
||||
|
||||
Reference in New Issue
Block a user