目前是用afterEach实现的,但这种只能读component的值,始终跟传统网页的效果差太多。有没有其他实现的办法?
1 回答
互换的青春
TA贡献1797条经验 获得超6个赞
如果是vue-router2.0的话还可以把title设置到meta里面
然后用beforeEach来实现
router.beforeEach((to, from, next) => { document.title = to.meta.title
next()
})添加回答
举报
0/150
提交
取消
