Property "visible" must be accessed with "$data.visible"

xx1433251330發表於2020-04-10

Property “visible” must be accessed with “$data.visible”

@/store/modules/permission.js檔案下的hasPermission方法中的roles.some(role => route.meta.roles.includes(role))報錯,按照下面的程式碼修改好就行

function hasPermission(roles, route) {
  if (route.meta && route.meta.roles) {
    if (route.meta.roles.indexOf(roles) > -1) {
      return true
    } else {
      return false
    }
    // return roles.some(role => route.meta.roles.includes(role))
  } else {
    return true
  }
}

相關文章