/*
 * @Company: 沈阳信诚科技
 * @Email: html_venustar@163.com
 * @Author: Liuqiming
 * @Description: 多次点击同一按钮短时间禁用
 * @LastEditors: Liuqiming
 * @LastEditTime: 2024-02-28 14:20:38
 * @Date: 2024-02-28 12:23:52
 */
export default {
  beforeMount(el, { value }) {
    const handler = () => {
      if (!el.disabled) {
        el.disabled = true;
        setTimeout(() => {
          el.disabled = false
        }, value)
      }
    }
    el.addEventListener("click", handler);
    el.$destroyCopy = () => el.removeEventListener("click", handler);
  }
}