标签:发送 interval 计时 col let 获取 span tst 验证码
this.state = { btnText: ‘获取验证码‘, timer: 5, discodeBtn: false, clearInterval: false } let siv = setInterval(() => { this.setState({ timer: (timer--), btnText: timer, discodeBtn: true }, () => { if (timer === 0) { clearInterval(siv); this.setState({ btnText: ‘重新发送‘, discodeBtn: false }) } }); }, 1000);
标签:发送 interval 计时 col let 获取 span tst 验证码
原文地址:https://www.cnblogs.com/hcxwd/p/9188878.html