File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 4
4
< meta charset ="UTF-8 " />
5
5
< link rel ="icon " href ="/favicon.ico " />
6
6
< meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
7
- < title > Vuetify 3</ title >
8
7
<!-- FONTS -->
9
8
< link rel ="preconnect " href ="https://fonts.googleapis.com " />
10
9
< link rel ="preconnect " href ="https://fonts.gstatic.com " crossorigin />
Original file line number Diff line number Diff line change 1
1
// Composables
2
- import { createRouter , createWebHistory } from "vue-router" ;
2
+ import { createRouter , createWebHistory , RouteRecordRaw } from "vue-router" ;
3
3
import Home from "@/views/Home.vue" ;
4
4
import CV from "@/views/CV.vue" ;
5
5
import Social from "@/views/Social.vue" ;
6
+ import { profile } from "@/models/profile" ;
7
+ import Vue from "vue" ;
6
8
7
- export const routes = [
9
+ export const routes : RouteRecordRaw [ ] = [
8
10
{
9
11
path : "/" ,
10
12
name : "Accueil" ,
@@ -16,6 +18,9 @@ export const routes = [
16
18
path : "/CV" ,
17
19
name : "CV" ,
18
20
component : CV ,
21
+ meta : {
22
+ title : `CV ${ profile . name } ` ,
23
+ } ,
19
24
} ,
20
25
{
21
26
path : "/Social" ,
@@ -29,4 +34,11 @@ const router = createRouter({
29
34
routes,
30
35
} ) ;
31
36
37
+ router . afterEach ( ( to , from ) => {
38
+ // Use next tick to handle router history correctly
39
+ // see: https://github.com/vuejs/vue-router/issues/914#issuecomment-384477609
40
+ document . title =
41
+ ( to . meta . title as string ) || to . name ?. toString ( ) || profile . name ;
42
+ } ) ;
43
+
32
44
export default router ;
You can’t perform that action at this time.
0 commit comments