const auth = {
  mounted(el, binding, vnode, prevVnode) {
    const permission = binding.value;
    const btnFlag = auth.hasPerm(permission);
    if (!btnFlag) {
      el.parentNode.removeChild(el);
    }
  },
  hasPerm(permission) {
    if (permission === true || permission === void 0 || permission === "") {
      return true;
    }
    let btnFlag = false;
    const myBtns = window.$store.getters.funcAuthList;
    for (let i in myBtns) {
      if (myBtns[i] === permission) {
        btnFlag = true;
        break;
      }
    }
    return btnFlag;
  }
};
auth.install = function(Vue) {
  Vue.directive("fec-auth", auth);
};
export {
  auth as default
};
