当前位置:网站首页>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
边栏推荐
- Results fill in the blank. How many days of national day are Sundays (solved by pure Excel)
- DHCP原理与配置
- Custom component -- communication between parent and child components
- On cookies and session
- Cocos2d-x learning notes Tile Map tiledmap
- Applets: lifecycle
- Servlet
- What is a linear table?
- [learning notes] linked list operation
- raid磁盘阵列
猜你喜欢

MySQL installation and use

MOOC Weng Kai C language week 7: array operation: 1. array operation 2. Search 3. preliminary sorting

修复故障扇区

DHCP服务

DHCP service

LNMP搭建过程详解

Applet creation component

Installation and configuration of unit test framework jest with typescript

How to describe a bug and the definition and life cycle of bug level

NAT和PAT的原理及配置
随机推荐
Insertion and deletion of nodes in linked list
Shell script -- program conditional statements (conditional tests, if statements, case branch statements, echo usage, for loops, while loops)
Traversal binary tree
MOOC Weng Kai C language week 7: array operation: 1. array operation 2. Search 3. preliminary sorting
Forward and backward slash notes
组管理和权限管理
JS string method Encyclopedia
小甲鱼C(第六章数组1、2)
[learning notes] VIM editor
Applet custom components - data, methods, and properties
Esxi arm edition version 1.10 update
Technology sharing | do you know the functions of the server interface automated testing and requests library?
MOOC Weng Kai C language fourth week: further judgment and circulation: 1. Logical types and operations 2. Judgment of cascading and nesting
Ubuntu18.04+centos7 configure redis master-slave [learning notes]
Icc2 analysis timing artifact analyze_ design_ violations
DOM Foundation
YUM仓库的搭建
Wechat applet custom compilation mode
How to describe a bug and the definition and life cycle of bug level
Test interview questions collection (III) | computer network and database (with answers)