官方请注意,picker省市区组件,同页面使用setInterval,会报错

发布于 7 年前作者 nadai6181 次浏览最后编辑 7 年前来自 ask

定时器开启,选择地址,省,市都可以联动,当选到区的时候 会报错

Wed Feb 20 2019 10:27:25 GMT+0800 (中国标准时间) 渲染层错误

VM1497:5 TypeError: Cannot read property ‘code’ of undefined

(anonymous) @ VM1497:5

定时器结束后,恢复正常

2 回复
xiuyingwu
xiuyingwu1 楼6 年前

let times = 60*2; // 2分钟 用于倒计时

_this.time = times + ‘s’;

let aaa = setInterval(function () {

times–;

_this.time = times + ‘s’;

if (times < 0) {

_this.time = ‘重新获取’;

_this.isClick = true;

clearInterval(aaa);

}

}, 1000)

就是简单的定时器

jfeng
jfeng2 楼6 年前

烦提供能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html