From 4e60564fbf6b6c26ac5cd2977daa70e48d72c1b6 Mon Sep 17 00:00:00 2001 From: chensiAb <chenchenco03@163.com> Date: Thu, 07 Nov 2024 17:14:16 +0800 Subject: [PATCH] fix:CinputPhoneCode-每次点击获取验证码清除定时器 --- forms/input/CInputPhoneCode.vue | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/forms/input/CInputPhoneCode.vue b/forms/input/CInputPhoneCode.vue index 59d9105..eef97fd 100644 --- a/forms/input/CInputPhoneCode.vue +++ b/forms/input/CInputPhoneCode.vue @@ -60,6 +60,7 @@ return { cd: 60, holding: false, + timer: null, }; }, computed: { @@ -79,7 +80,8 @@ const startCD = () => { this.holding = true; this.cd = 60; - setInterval(() => { + clearInterval(this.timer); + this.timer = setInterval(() => { this.cd -= 1; if (this.cd === 0) { this.holding = false; -- Gitblit v1.9.1