当前位置:网站首页>List adding timer (positive and countdown)
List adding timer (positive and countdown)
2022-06-28 19:17:00 【Tiangao renniaofei dyz (front end)】
// To obtain a list of
onload() {
getList().then(res => {
this.tableData = res.data.data.records;
// timer
this.tableData.forEach(el=>{
el.excessTime = Date.now(); // Initial time value
this.isTimingcheng(el); // Each mount timer
})
});
}
// timer
isTimingcheng(row) {
if ( Judge when the condition clears the timer ) {
row.countDown = setInterval(() => {
row.excessTime = row.excessTime + 1000;
this.$forceUpdate(); // Refresh every update dom
}, 1000);
} else {
clearInterval(row.countDown); // Clear timer
}
}
// Clear all timers
clearAll(list){
list.forEach(el=>{
clearInterval(el.countDown)
})
}Each row of the list has its own timing !!!
边栏推荐
- Ffmpeg usage in video compression processing
- leetcode 1423. Maximum points you can obtain from cards
- Understanding of closures
- Paper 3 vscode & texlive & sumatrapdf create a perfect tool for writing papers
- 直播app系统源码,动态遇到视频时开始自动播放
- C# 41. Int to string
- 小白创业做电商,选对商城系统很重要!
- Jenkins Pipeline 对Job参数的处理
- Hands on Teaching of servlet use (1)
- Cannot read property 'MTJ' of undefined
猜你喜欢

How to remove dataframe field column names

论文3 VScode&texlive&SumatraPDF打造完美书写论文工具

Professor Michael Wooldridge of Oxford University: how the AI community views neural networks in the past 40 years

Markdown绘图mermaid实用教程

深度学习需要多强的数学基础?

团体程序设计天梯赛练习题-持续更新中

怎样去除DataFrame字段列名

C# 41. Int to string

令人惊艳的NanoPC-T4(RK3399)作为工作站的初始配置和相关应用

SQL interview question: find the maximum number of consecutive login days
随机推荐
PostgreSQL database docker
Business layer modification - reverse modification based on the existing framework
春风动力携手华为打造智慧园区标杆,未来工厂创新迈上新台阶
应用实践 | 10 亿数据秒级关联,货拉拉基于 Apache Doris 的 OLAP 体系演进(附 PPT 下载)
C language file operation
怎样去除DataFrame字段列名
深度学习需要多强的数学基础?
Openharmony - detailed source code of Kernel Object Events
Pipeline based hybrid rendering
Servlet的使用手把手教学(一)
About Statistical Distributions
G biaxial graph SQL script
Cannot read property 'MTJ' of undefined
Cvpr2022 | Zhejiang University and ant group put forward a hierarchical residual multi granularity classification network based on label relation tree to model hierarchical knowledge among multi granu
微博评论的高性能高可用计算架构方案
mysql全解 Ubuntu/win10
How to remove dataframe field column names
Constrained Delaunay triangulation in MATLAB
How does the computer check whether the driver is normal
视频压缩处理之ffmpeg用法