setInterval(function(){}, number 时间间隔/ms)
注意在setInterval中定义的函数中使用 this 指向的是该计时器,若要用到页面数据应如下操作:
let that=this
setInterval(function(){
that.data.a=0;
},number 时间间隔/ms)
通过在setInterval外面设置一个变量 that 获得 页面 this 的引用,后进行操作
setInterval(function(){}, number 时间间隔/ms)
注意在setInterval中定义的函数中使用 this 指向的是该计时器,若要用到页面数据应如下操作:
let that=this
setInterval(function(){
that.data.a=0;
},number 时间间隔/ms)
通过在setInterval外面设置一个变量 that 获得 页面 this 的引用,后进行操作