在router/index.js写路由的js中添加一段代码:
router.beforeEach((to, from, next) => { const { title } = to.meta if (title) { document.title = `标题 | ${title}` } next() }) export default router