当前位置:网站首页>防止重复点击
防止重复点击
2022-07-29 01:32:00 【一只小炸毛】
防止重复点击
防止重复点击
import Vue from 'vue'
const noReClick = Vue.directive('noReClick', {
inserted: function (el, binding) {
el.addEventListener('click', () => {
if (!el.disabled) {
el.disabled = true
setTimeout(() => {
el.disabled = false
}, binding.value || 1000)
}
})
}
});
export {
noReClick }
main.js
import noReClick from './XXX/noReClick ' // 防多次点击,重复提交
使用
<el-button v-noReClick >确定</el-button>
边栏推荐
- 「活动推荐」冲冲冲!2022 国际开源节有新内容
- MotionLayout--在可视化编辑器中实现动画
- TI C6000 TMS320C6678 DSP+ Zynq-7045的PS + PL异构多核案例开发手册(2)
- What is browser fingerprint recognition
- Leetcode 242. valid anagram
- ciscn 2022 华中赛区 misc
- leetcode/和为k的连续子数组个数
- Sharpness evaluation method without reference image
- Implementation of 10m multifunctional signal generator with FPGA
- Lm13 morphological quantification momentum period analysis
猜你喜欢

【云原生与5G】微服务加持5G核心网

Talk about possible problems when using transactions (@transactional)

物联网开发--MQTT消息服务器EMQX

JS dom2 and dom3

TI C6000 TMS320C6678 DSP+ Zynq-7045的PS + PL异构多核案例开发手册(2)

「活动推荐」冲冲冲!2022 国际开源节有新内容

Using local cache + global cache to realize user rights management of small systems

Verilog procedure assignment statements: blocking & non blocking
![[electronic components] constant voltage, amplify the current of the load (triode knowledge summary)](/img/07/d5861404a76a0fb7d6d5f930a4a66a.png)
[electronic components] constant voltage, amplify the current of the load (triode knowledge summary)

Mobile communication -- simulation model of error control system based on convolutional code
随机推荐
Anti crawler mechanism solution: JS code generates random strings locally
Opencv image sharpness evaluation (camera autofocus)
LM13丨形态量化-动量周期分析
Nine days later, we are together to focus on the new development of audio and video and mystery technology
How companies make business decisions -- with the help of data-driven marketing
Comprehensive use method of C treeview control
iVX低代码平台系列详解 -- 概述篇(二)
点击回到顶部js
Solution of Lenovo notebook camera unable to open
基于 ICA 与 DL 的语音信号盲分离
How to prevent all kinds of affiliated fraud?
Rgbd point cloud down sampling
leetcode/和为k的连续子数组个数
QT memory management tips
How to find the right agent type? Multi angle analysis for you!
autoware中ndtmatching功能加载点云图坐标系修正的问题
Thirty years of MPEG audio coding
【ONE·Data || 数组堆简单实现及其延伸】
Mathematical modeling -- Optimization of picking in warehouse
As long as I run fast enough, it won't catch me. How does a high school student achieve a 70% salary increase under the epidemic?