/** * @description 节流指令 * 限制连续快速点击按钮 * 用例:text * */ export default { inserted(el, binding, vnode) { el.addEventListener("click", () => { if (!el.disabled) { el.disabled = true; setTimeout(() => { el.disabled = false; }, binding.value || 1000); } }); } };