注意:如果是嵌套路由,我们可能获取不到嵌套路由的标题。这时候我们只需要修改为
// 全局前置守卫,设置页面标题
router.beforeEach((to, from, next) => {
// to and from are both route
注意:如果是嵌套路由,我们可能获取不到嵌套路由的标题。这时候我们只需要修改为
// 全局前置守卫,设置页面标题
router.beforeEach((to, from, next) => {
// to and from are both route