当前位置:网站首页>小程序 组件 定时器的清除
小程序 组件 定时器的清除
2022-07-28 20:17:00 【雨住一_abc】
data() {
return {
timing: null, // 定时器
}
},
destroyed: function() {
clearInterval(this.timing)
},
//在组件内onUnload,onHide无法监听到,要用组件内的监听方法,在组件销毁时使用 destroyed 清除定时器
//设置定时器
setTime() {
this.timing = setInterval(() => {
}, 1000)
},
边栏推荐
- 第 8 篇:创建摄像机类
- KubeVela 1.4.x 官方文档
- 使用Mock技术帮助提升测试效率的小tips,你知道几个?
- 40. 组合总和 II
- kubevela插件addons下载地址
- 软考 --- 数据库(3)数据操作
- 如何优雅的设计工作流引擎(荣耀典藏版)
- Leetcode 19. delete the penultimate node of the linked list [knowledge points: speed pointer, recursion, stack]
- 字节一面:TCP 和 UDP 可以使用同一个端口吗?
- The Swedish court lifted the 5g spectrum auction ban on Huawei and ZTE
猜你喜欢

凡尔赛天花板:“毕业两年月薪才35K,真是没出息啊~~”

Apifox:满足你对 Api 的所有幻想

数据可视化新闻,不一样的新闻报道形式

Meeting notice of OA project (Query & whether to attend the meeting & feedback details)
![[Bluetooth Bluetooth development] VIII. Transmission layer of ble protocol](/img/43/7c3891befcb7cbb7dc67dfdeb763e2.png)
[Bluetooth Bluetooth development] VIII. Transmission layer of ble protocol

Oracle database objects

Explain the remote debugging program of visual studio 2015 in LAN

Implementation of sequence table

How is nanoid faster and more secure than UUID implemented? (glory Collection Edition)

JVM 内存布局详解(荣耀典藏版)
随机推荐
Bully is filed for bankruptcy! The company has become a "Lao Lai", and the legal person is restricted from high consumption
Object based real-time spatial audio rendering - Dev for dev column
Explain the remote debugging program of visual studio 2015 in LAN
Which brand is the best and most cost-effective open headset
基于多模态融合的非遗图片分类研究
Week 6 Linear Models for Classification (Part B)
kali里的powersploit、evasion、weevely等工具的杂项记录
Assign a string pointer to an array [easy to understand]
Wechat applet development company, do you know how to choose?
ESP8266-Arduino编程实例-SPIFFS及数据上传(Arduino IDE和PlatformIO IDE)
The Swedish court lifted the 5g spectrum auction ban on Huawei and ZTE
小程序开发需要什么技术
kingbase中指定用户默认查找schema,或曰用户无法使用public schema下函数问题
Information fusion method and application of expert opinion and trust in large group emergency decision-making based on complex network
[geek challenge 2019] secret file & file contains common pseudo protocols and gestures
Pytoch learning record (III): random gradient descent, neural network and full connection
详解visual studio 2015在局域网中远程调试程序
微信小程序开发入门,自己开发小程序
40. 组合总和 II
Matlab | basic knowledge summary I