![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
定时器
龙拳蜗牛
干啊
展开
-
Vue 倒计时 PC 移动端
data() { return { match_date: '', countDownList: '00天00时00分00秒' } timeFormat(param) { return param < 10 ? '0' + param : param }, countDown(it) { var interval = setInterval(() => { // 获取当前时间,同时得到活动...原创 2020-05-29 19:47:32 · 313 阅读 · 0 评论 -
清除定时器 延时器
mounted 中 写下延时器 mounted() { this.timer = setTimeout(() => { this.$router.push('/login') }, 3000) }, 清除定时器 beforeDestroy 如果 引入了以下: 代码: import { clearTimeout } from 'timers' 需要 添加 window 才能找到 clearTimeout beforeDestroy() { win原创 2020-05-22 16:13:06 · 3042 阅读 · 0 评论