当前位置:网站首页>Uni app double click event simulation
Uni app double click event simulation
2022-07-28 07:04:00 【SheepOnTheCloud】
Ideas : Set a variable array , Click to add a timestamp to the array , Enough two to empty , Judge whether the difference between the two timestamps is within the specified event
vue2
template in
<button @click="dblclick()"> I double click the event </button>data in
time: []methods in
dblclick(e) {
if (this.time.length < 2) {
this.time.push(new Date().getTime())
if (this.time[this.time.length - 1] - this.time[0] < 500) {// Configure multiple seconds as double click
if (this.time[this.time.length - 1] - this.time[0] == 0) {
console.log(' Odd hits ')
} else {
console.log('0.5s Inner Click ')
this.time = []
}
} else {
console.log('0.5s External Click ')
this.time = []
}
} else {
this.time = []
}
console.log(this.time)
},summary
边栏推荐
- NAT和PAT的原理及配置
- Esxi community network card driver updated in March 2022
- Blue bridge code error ticket
- Hdu-5805-nanoape loves sequence (thinking questions)
- Build php7 private warehouse
- [learning notes] thread creation
- About gcc:multiple definition of
- Test interview questions collection (V) | automated testing and performance testing (with answers)
- DOM - Events
- Shell script - "three swordsmen" awk command
猜你喜欢

NFS shared storage service

DNS域名解析服务

防火墙——iptables防火墙(四表五链、防火墙配置方法、匹配规则详解)

DOM -- event chain, event bubble and capture, event proxy

MySQL build database Series (I) -- download MySQL

Wechat applet custom compilation mode

Applet navigator cannot jump (debug)

MOOC翁恺 C语言 第三周:判断与循环:2.循环

shell脚本——正则表达式

Applet custom components - data, methods, and properties
随机推荐
Clock tree analysis example
Canvas drawing 2
Hdu-5783 divide the sequence (greedy water question)
JS four operations are repackaged to solve the problem of precision loss
Esxi community network card driver
Wechat applet custom compilation mode
MOOC Weng Kai C language week 8: pointer and string: 1. Pointer 2. Character type 3. String 4. String calculation
Technology sharing | common proxy tools for interface testing
shell脚本——编程条件语句(条件测试、if语句、case分支语句、echo用法、for循环、while循环)
About gcc:multiple definition of
Common models in software development
Servlet
LNMP搭建过程详解
Small turtle C (Chapter 6 arrays 1 and 2)
Pku-2524-ubiquitous relations (parallel search template)
Results fill in the blanks carelessly (violent solution)
Result fill in the blank (dfs*c language)
DNS domain name resolution service
Technology sharing | send requests using postman
MOOC翁恺C语言第五周:1.循环控制2.多重循环3.循环应用