mirror of
https://github.com/sunniejs/vue-h5-template.git
synced 2025-10-06 03:09:59 +08:00
修复title的bug
This commit is contained in:
parent
a77005900f
commit
9d3fd87b05
@ -27,4 +27,13 @@ export function resetRouter() {
|
||||
router.matcher = newRouter.matcher // reset router
|
||||
}
|
||||
|
||||
// 设置title
|
||||
router.beforeEach((to, from, next) => {
|
||||
/* 路由发生变化修改页面title */
|
||||
if (to.meta.title) {
|
||||
document.title = to.meta.title
|
||||
}
|
||||
next()
|
||||
})
|
||||
|
||||
export default router
|
||||
|
Loading…
x
Reference in New Issue
Block a user