import hasRole from './hasRole'
import hasPermi from './hasPermi'
import hasPermiAnd from './hasPermiAnd'

const install = function(Vue) {
  Vue.directive('hasRole', hasRole)
  Vue.directive('hasPermi', hasPermi)
  Vue.directive('hasPermiAnd', hasPermiAnd)
}

if (window.Vue) {
  window['hasRole'] = hasRole;          //角色权限(暂时已废弃)
  window['hasPermi'] = hasPermi;        //权限字段权限(或判断)
  window['hasPermiAnd'] = hasPermiAnd;  //权限字段权限(与判断)
  Vue.use(install); // eslint-disable-line
}

export default install
