当前位置:网站首页>按钮多次点击造成结果
按钮多次点击造成结果
2022-06-25 11:30:00 【你的美,让我痴迷】
// 防止处理多次点击
function noMultipleClicks(methods, info) {
// methods是需要点击后需要执行的函数, info是点击需要传的参数
let that = this;
if(!that.noClick){
that.noClick=true;
setTimeout(()=>{
that.noClick=false;
},5000)
if(info && info !== '') {
// info是执行函数需要传的参数
methods(info);
} else {
methods();
}
} else{
uni.showToast({
title:"点击频率过快,5s后再试",
icon:"none",
duration:500
})
}
}
//导出
export default {
noMultipleClicks,//禁止多次点击
}
在main.js使用
//配置公共方法
import common from './common/noMultipleClicks.js'
Vue.prototype.$noMultipleClicks = common.noMultipleClicks;
实战应用:
打印查看:
边栏推荐
- 金仓KFS数据集中场景(多对一)部署
- 基於Minifilter框架的雙緩沖透明加解密驅動 課程論文+項目源碼
- Apache ShenYu 入门
- What are the functions of arm64 assembly that need attention?
- CFCA Anxin sign access
- [shangyun boutique] energy saving and efficiency improvement! Accelerating the transformation of "intelligent manufacturing" in the textile industry
- Explanation and use of kotlin syntax for Android
- Yisheng biological sprint scientific innovation board: 25% of the revenue comes from the sales of new crown products, and it is planned to raise 1.1 billion yuan
- 动态规划解决股票问题(上)
- GCC related
猜你喜欢
记一次给OpenHarmony提交代码的过程
基于SSH的高校实验室物品管理信息系统的设计与实现 论文文档+项目源码及数据库文件
杭州/北京内推 | 阿里达摩院招聘视觉生成方向学术实习生(人才计划)
Design and implementation of university laboratory goods management information system based on SSH
Socket communication principle
Niuke: rotation array
Technical practice and development trend of video conference all in one machine
4 life distributions
Crawler scheduling framework of scratch+scratch+grammar
SQL注入漏洞(绕过篇)
随机推荐
16 enterprise architecture strategies
Double tampon transparent cryptage et décryptage basé sur le cadre minifilter
金太阳教育美股上市:市值3.6亿美元 成小盘中概股
An interesting logic SRC mining
Double buffer transparent encryption and decryption driven course paper + project source code based on minifilter framework
GC
Ladder Side-Tuning:预训练模型的“过墙梯”
GaussDB 集群维护案例集-sql执行慢
Design and implementation of university laboratory goods management information system based on SSH
Niuke.com: host scheduling
记一次给OpenHarmony提交代码的过程
Dynamic programming to solve stock problems (Part 1)
Gaussdb cluster maintenance case set - slow SQL execution
Handler、Message、Looper、MessageQueue
Free access to the global human settlements layer (ghsl) dataset from Gee
贝叶斯
Compilation of learning from Wang Shuang (1)
Course paper + code and executable EXE file of library information management system based on C language
At 16:00 today, Mr. sunxiaoming, a researcher of the Institute of computing, Chinese Academy of Sciences, took you into the quantum world
Kingbasees plug-in DBMS of Jincang database_ OUTPUT