vue:在router里面给页面加title
生活随笔
收集整理的這篇文章主要介紹了
vue:在router里面给页面加title
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
vue中給組件頁面加頁面標(biāo)題:
{
path: '/',
name: 'index',
component: disconnect,
meta: { title: '首頁' }
},
{
path: '/disconnect',
name: 'disconnect',
component: disconnect,
meta: { title: '沒有網(wǎng)絡(luò)' }
},
然后再main.js
router.beforeEach((to, from, next) => {
window.document.title = to.meta.title;
next()
})
轉(zhuǎn)載于:https://www.cnblogs.com/llqwm/p/9152082.html
總結(jié)
以上是生活随笔為你收集整理的vue:在router里面给页面加title的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 搜索框制作
- 下一篇: 如何获得Windows聚焦壁纸0726