import store from "@/store";

export default {
  inserted(el, bindling) {
    let perVal = bindling.value.btnID;
    let routeId = bindling.value.routeId;
    if (perVal && routeId) {
      let perObj = store.getters.getButtonPre;
      if (Object.keys(perObj).length) {
        let hasPer = perObj[routeId] && perObj[routeId].includes(perVal);
        if (!hasPer) {
          el.parentNode.removeChild(el);
        }
      }
    }
  },
};
