微信公开课
微信公开课小程序热门讨论关于「页面上多个定时器怎么清除」的小程序开发问题
补充:列表中有多个定时器怎么在退出页面时候清除多个定时器微信者回复开发者回复onload里面thistickers=然后每创建一个timer就push进去一个thistickerspush(setInterval(func,1000)onUnload里面thist
展开:列表中有多个定时器怎么在退出页面时候清除多个定时器即速小程序:onload里面thistickers=[]然后每创建一个timer就push进去一个thistickerspush(setInterval(func,1000)onUnload里面thistickersforearch(t={if(t){clearInterval(t)}}):在onHide和onUnload里边清除:onUnload:function(){TODO:clearTimeout}
更多有关「页面上多个定时器怎么清除」的讨论可以前往微信公开课小程序参与互动哦!了解更多