import hasRole from './permission/hasRole'
import hasPermi from './permission/hasPermi'
import hasPermiAnd from './permission/hasPermiAnd'
import hasPermiRouter from './permission/hasPermiRouter'
import dialogDrag from './dialog/drag'
import dialogDragWidth from './dialog/dragWidth'
import dialogDragHeight from './dialog/dragHeight'

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

if (window.Vue) {
  window['hasRole'] = hasRole
  window['hasPermi'] = hasPermi
  window['hasPermiAnd'] = hasPermiAnd
  window['hasPermiRouter'] = hasPermiRouter
  Vue.use(install); // eslint-disable-line
}

export default install
