在main.js中:

代码贴出来
router.beforeEach((to,from,next)=>{
if(to.meta.title){
document.title=to.meta.title
}
next()
})
在路由配置中:

在main.js中:
代码贴出来
router.beforeEach((to,from,next)=>{
if(to.meta.title){
document.title=to.meta.title
}
next()
})
在路由配置中:
本文标题:用vue做公众号切换页面修改title
本文链接:https://www.haomeiwen.com/subject/tbygpktx.html
网友评论