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

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
  }
}

你可能感兴趣的:(vue)