// 控制页面按钮权限，有2种做法，一种是写在这里；一种写在directive
import Vue from 'vue'
import store from '@/store'
const dataPermission = Vue.directive('dataPermission', {
  inserted: function(el, binding) {
    checkDataPermission(el, binding)
  }
  /* update(el, binding) {
    checkDataPermission(el, binding)
  } */
})

export { dataPermission }

function checkDataPermission(el, binding) {
  const ownerOrganize = store.getters && store.getters.ownerOrganize
  if (binding.value) {
    el.style.display = 'none'
  } else {
    el.style.display = 'block'
  }
}
