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()
})