[微信小程序]官方请注意,picker省市区组件,同页面使用setInterval,会报错 [机器也是需要休息滴]+ 查看更多
[微信小程序]官方请注意,picker省市区组件,同页面使用setInterval,会报错 [机器也是需要休息滴]
+ 查看更多
定时器开启,选择地址,省,市都可以联动,当选到区的时候 会报错
Wed Feb 20 2019 10:27:25 GMT+0800 (中国标准时间) 渲染层错误
VM1497:5 TypeError: Cannot read property 'code' of undefined
(anonymous) @ VM1497:5
定时器结束后,恢复正常
-
, 如果你什么都不说,我也不知道怎么回答你呀麻烦提供能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html), QQ那玩意就像泡女朋友,等星星,等月亮,然后就有太阳了
-
我是使用mpvue写的,不知道如何生成代码片段, 你这个问题好奇怪。
-
区域的代码 <view class="cellRight"> <picker mode="region" @change="bindRegionChange" :value="region" :custom-item="customItem"> <view class="picker"> {{addressName}}<i class="iconfont icon-search-1-copy btnIcon"></i> </view> </picker> </view> 验证码 <view class="cellLeft">手机验证</view> <view class="cellRight80" style="width:70%;"> <input type="number" class="cellText100" v-model="verificationCode" style="margin-right:5px;width:200px;" placeholder="请填写"/> <view class="cellRight" @tap="isClick & gainCode()" style="width:31%;border-left:1px solid;"> {{time}} </view> </view> 触发方法 gainCode: function () { let _this=this; if(!this.isClick){ return; } _this.isClick = false; let times = 60*2; // 2分钟 用于倒计时 _this.time = times + 's'; let interval = setInterval(function () { times--; _this.time = times + 's'; if (times < 0) { _this.time = '重新获取'; _this.isClick = true; clearInterval(interval); } }, 1000) } , 说的貌似很有深意,你能一条一条说么?
, 如果你什么都不说,我也不知道怎么回答你呀 -
-
, 如果你什么都不说,我也不知道怎么回答你呀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) 就是简单的定时器 , 说的貌似很有深意,你能一条一条说么?, 如果你什么都不说,我也不知道怎么回答你呀