router > index.js
{ path: '/worklist', name: 'worklist', component: worklist, meta: {title:'维修工列表',keyword:'success-list',description:'维修工列表'}, },
main.js
router.beforeEach((to, from, next) => { /* 路由发生变化修改页面title */ if (to.meta.title) { document.title = to.meta.title } next() })
router.beforeEach((to, from, next) => {
/* 路由发生变化修改页面title */
if (to.meta.title) {
document.title = to.meta.title
}
next()
})