收藏
回答

setInterval在华为P20失效

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug setInterval 微信安卓客户端 7.0.6 2.8.3
setLineTime(){
 
let _this = this;
 
let x = 0;
 
let imgs = [
 
line1:'https://img.cdn.zhaoshang800.com/img/2019/07/29/broker/04e17c4f-6f59-412f-995f-6b45a8adea60.png',
 
line2:'https://img.cdn.zhaoshang800.com/img/2019/07/29/broker/b8f84cbf-d39f-4e08-9afe-1a5cb374cfb5.png',
 
line3:'https://img.cdn.zhaoshang800.com/img/2019/07/29/broker/7b65a69f-4bb4-45bb-b088-124eb314a5fe.png',
 
];
 
// console.log('setLineTime')
 
timerLine = setInterval(
 
function(){
 
x++;
 
x = x % 3;
 
_this.setData({
 
arrLine: imgs[x]
 
});
 
// console.log(timerLine, 'timerLine')
 
// console.log(_this.data.arrLine, 'arrLine')
 
}
 
, 1000)
 
},
 

在开发者工具和ios上能打印出console.log(timerLine, 'timerLine')和console.log(_this.data.arrLine, 'arrLine')

在我的安卓手机就不执行setInterval的内部代码

回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容
问题标签