Skip to content

Commit 9435200

Browse files
authored
Merge pull request #7 from YSHgroup/feature/seo
Merge Feature/seo into main
2 parents fb71732 + 28c035a commit 9435200

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const dateClicked = (date: string) => {
1717
<template>
1818
<b-row >
1919
<b-col cols="12" class="bg-secondary text-white col-xxl-2">
20-
<side-nav msg="Calendar">
20+
<side-nav msg="FullCalendar with Vue 3">
2121
<template v-slot:content>
2222
<vue-date-picker
2323
v-model="date"

src/router/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { createRouter, createWebHistory } from 'vue-router'
2+
import { nextTick } from 'vue'
23
import routes from './routes'
34

5+
const BASE_TITLE = "Calendar - Vue3"
46
const router = createRouter({
57
scrollBehavior: () => ({top: 0, left: 0}),
68
history: createWebHistory(import.meta.env.BASE_URL),
@@ -14,4 +16,14 @@ router.beforeEach((to, from, next) => {
1416
next()
1517
})
1618

19+
router.afterEach(( to, from )=>{
20+
if(to.meta.title) {
21+
nextTick(() => {
22+
document.title = `${to.meta.title} | ${BASE_TITLE}`
23+
})
24+
} else {
25+
document.title = BASE_TITLE
26+
}
27+
})
28+
1729
export default router

0 commit comments

Comments
 (0)