修复title的bug

This commit is contained in:
wangjiahao 2020-12-25 13:59:21 +08:00
parent a77005900f
commit 9d3fd87b05

View File

@ -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