vueページのtitleの変更
h 5では、ジャンプページに異なるページタイトルが表示されます.
ルーティング内のmetaにtitleを追加し、グローバルルーティングガードがページのタイトルを変更します.
routes: [
{
path: '/',
name: 'Entrance',
component: Entrance,
meta: {
title: ' '
}
}
]
router.beforeEach((to, from, next) => {
/* title */
if (to.meta.title) {
document.title = to.meta.title
}
next()
})
ルーティング内のmetaにtitleを追加し、グローバルルーティングガードがページのタイトルを変更します.