当前位置:网站首页>uni-app-双击事件模拟
uni-app-双击事件模拟
2022-07-28 05:18:00 【SheepOnTheCloud】
思路:设置一个变量数组,点击后对数组进行追加时间戳,够两个就清空,判断两次时间戳的差距是否在规定的事件呢
vue2
template中
<button @click="dblclick()">我是双击事件</button>data中
time: []methods中
dblclick(e) {
if (this.time.length < 2) {
this.time.push(new Date().getTime())
if (this.time[this.time.length - 1] - this.time[0] < 500) {//配置多晒秒内为双击
if (this.time[this.time.length - 1] - this.time[0] == 0) {
console.log('奇数点击')
} else {
console.log('0.5s内点击')
this.time = []
}
} else {
console.log('0.5s外点击')
this.time = []
}
} else {
this.time = []
}
console.log(this.time)
},总结
边栏推荐
- When using \hl for highlighting, latex always reports an error when encountering a reference, showing that there are fewer or more parentheses
- When SQL queries the list, the data is inconsistent twice, and limit is automatically added
- Openjudge: find all substring positions
- When using deep learning training image, the image is too large for segmentation training prediction
- MySQL uses list as a parameter to query
- Edge calculation kubeedge+edgemash
- 顺序表oj之删除特定的元素
- How to compare long and integer and why to report errors
- 深度学习热力图可视化的方式
- JVM篇 笔记3:类加载与字节码技术
猜你喜欢

Writing methods of scientific research papers: add analysis and discussion in the method part to explain their contributions and differences

RESNET structure comparison

Redis' bloom filter

Mutual conversion between latex and word

科研论文写作方法:在方法部分添加分析和讨论说明自己的贡献和不同

冶金物理化学复习 ---- 气固反应动力学

Example of main diagram of paper model

GET与POST区别

Edge calculation kubeedge+edgemash

链表中关于快慢指针的oj题
随机推荐
冶金物理化学复习 ---- 气固反应动力学
Digital twin technology creates visual application of smart mine
JVM篇 笔记3:类加载与字节码技术
标准C语言学习总结8
Thesis writing function words
c语言:通过一个例子来认识函数栈帧的创建和销毁讲解
How Visio can quickly generate the same pattern and image matrix
Oracle create table, delete table, modify table (add field, modify field, delete field) statement summary
论文模型主图范例
Leetcode 随即链表的深拷贝
Writing methods of scientific research papers: add analysis and discussion in the method part to explain their contributions and differences
Fusiongan code learning (I)
Oracle uses SQL to query the field information of a table (field type, length, etc.)
Mysql database index (InnoDB engine)
冶金物理化学复习 --- 冶金反应动力学基础与多相反应动力学特征
openjudge:石头剪刀布
Database interview
Openjudge: maximum span of string
GET与POST区别
There is no crossover in the time period within 24 hours