动态页面标题的实现

39 阅读1分钟

先给路由设置meta属性

image.png

在permission页这样设置 记住在next()前设置 !!

    if(token){
      await store.dispatch("actionGetInFo")
    }

    // 设置页面标题
    let title = (to.meta.title ? to.meta.title : "") + "--kennyouchou"
    document.title = title
    next()

这样就可以了

image.png

image.png