当前位置:网站首页>防止重复点击
防止重复点击
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>
边栏推荐
- 基于C51控制蜂鸣器
- LeetCode 练习——剑指 Offer 45. 把数组排成最小的数
- 第十五天(VLAN相关知识)
- awvs无法启动问题
- 2022.7.27-----leetcode.592
- "Wei Lai Cup" 2022 Niuke summer multi school training camp 2, sign in question GJK
- leetcode/0和1个数相同的连续子数组
- webview攻击
- Mathematical modeling -- red wine quality classification
- Introduction to shared data center agent
猜你喜欢

In 2022, the official data of programming language ranking came, which was an eye opener

How to find the right agent type? Multi angle analysis for you!

Blind separation of speech signals based on ICA and DL

数学建模——公交调度优化

Mobile communication -- simulation model of error control system based on convolutional code

Thirty years of MPEG audio coding

Anti crawler mechanism solution: JS code generates random strings locally

Leetcode exercise - Sword finger offer 45. arrange the array into the smallest number

(arxiv-2018) reexamine the time modeling of person Reid based on video

Mathematical modeling -- heat conduction of subgrade on Permafrost
随机推荐
[electronic components] constant voltage, amplify the current of the load (triode knowledge summary)
MotionLayout--在可视化编辑器中实现动画
FPGA实现10M多功能信号发生器
TI C6000 TMS320C6678 DSP+ Zynq-7045的PS + PL异构多核案例开发手册(2)
MySQL stores JSON format data
Semiconductor chip industry chain
[circuit design] peak voltage and surge current
Navigation--实现Fragment之间数据传递和数据共享
Mathematical modeling - location of police stations
【MySQL】sql给表起别名
数学建模——永冻土层上关于路基热传导问题
Leetcode 242. valid anagram
Idea connection database
Anti crawler mechanism solution: JS code generates random strings locally
Have you ever encountered the situation that the IP is blocked when crawling web pages?
Click back to the top JS
2022.7.28-----leetcode.1331
Control buzzer based on C51
What is the function of data parsing?
数学建模——公交调度优化