vue:在router里面给页面加title
生活随笔
收集整理的這篇文章主要介紹了
vue:在router里面给页面加title
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
vue中給組件頁面加頁面標題:
{
path: '/',
name: 'index',
component: disconnect,
meta: { title: '首頁' }
},
{
path: '/disconnect',
name: 'disconnect',
component: disconnect,
meta: { title: '沒有網絡' }
},
然后再main.js
router.beforeEach((to, from, next) => {
window.document.title = to.meta.title;
next()
})
轉載于:https://www.cnblogs.com/llqwm/p/9152082.html
總結
以上是生活随笔為你收集整理的vue:在router里面给页面加title的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 搜索框制作
- 下一篇: 记录一下使用vue/vuex+SSR框架