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

转载于:https://www.cnblogs.com/hzx-5/p/9761921.html

Logo

前往低代码交流专区

更多推荐