<view v-if="coding == false" @click="getCode()">获取验证码</view>
<view v-else>{{ auth_time }}秒</view>
//设置倒计时秒
getCode(){
this.auth_time = 60;
this.coding = true;
let timetimer = setInterval(() => {
this.auth_time--;
if (this.auth_time < 0) {
this.coding = false;
clearInterval(timetimer);
}
}, 1000);
}
验证码功能
最新推荐文章于 2024-07-24 00:03:51 发布