export const preReClick = {
  mounted(el, binding) {
    console.log("binding", binding.value);
    let time = null;
    el.addEventListener("click", () => {
      clearTimeout(time);
      time = setTimeout(async () => {
        try {
          el.disabled = true;
          binding.value && (await binding.value());
          el.disabled = false;
        } catch (error) {
          el.disabled = false;
        }
      }, 300);
    });
  },
};
