Skip to content

Commit

Permalink
Merge pull request #7 from YSHgroup/feature/seo
Browse files Browse the repository at this point in the history
Merge Feature/seo into main
  • Loading branch information
YSHgroup authored Jul 13, 2024
2 parents fb71732 + 28c035a commit 9435200
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const dateClicked = (date: string) => {
<template>
<b-row >
<b-col cols="12" class="bg-secondary text-white col-xxl-2">
<side-nav msg="Calendar">
<side-nav msg="FullCalendar with Vue 3">
<template v-slot:content>
<vue-date-picker
v-model="date"
Expand Down
12 changes: 12 additions & 0 deletions src/router/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { createRouter, createWebHistory } from 'vue-router'
import { nextTick } from 'vue'
import routes from './routes'

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

router.afterEach(( to, from )=>{
if(to.meta.title) {
nextTick(() => {
document.title = `${to.meta.title} | ${BASE_TITLE}`
})
} else {
document.title = BASE_TITLE
}
})

export default router

0 comments on commit 9435200

Please sign in to comment.