码迷,mamicode.com
首页 > 其他好文 > 详细

vue 使用定时器setInterval

时间:2019-01-29 18:02:18      阅读:964      评论:0      收藏:0      [点我收藏+]

标签:str   etc   ott   bye   com   设置   function   rem   UNC   

来自:https://www.jianshu.com/p/180957762852 侵删

beforeMount() {
//车辆进出设置定时器,每3秒刷新一次 var self = this; clearInterval(timer); let timer = setInterval(_getCarPeopleStreamByEntraceBottom, 3000) function _getCarPeopleStreamByEntraceBottom() { //生成随机数用来测试 let totelNumber = new Array(8); for (let i = 0; i < totelNumber.length; i++) { totelNumber[i] = Math.ceil(Math.random() * 10) - 1 }; let data = { carInNumber: totelNumber[0], carOutNumber: totelNumber[1] }; self.southPassagewayData = data; } _getCarPeopleStreamByEntraceBottom(); },

 

vue 使用定时器setInterval

标签:str   etc   ott   bye   com   设置   function   rem   UNC   

原文地址:https://www.cnblogs.com/Byme/p/10333966.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!