官方请注意,picker省市区组件,同页面使用setInterval,会报错
发布于 5 年前 作者 nadai 6026 次浏览 来自 问答

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

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

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

(anonymous) @ VM1497:5

定时器结束后,恢复正常

2 回复

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)

就是简单的定时器

回到顶部