vue3验证码倒计时60s
//倒计时60s const timeNum = ref(60); const countDown = ref(); const isShowSend = ref(true); const getSetInterval = (): void => { countDown.value = setInterval(() => { setTimeout(() => { if (timeNum.value > 0 && timeNum.value <= 60) { isShowSend.value = false; timeNum.value--; } else { isShowSend.value = true; clearInterval(countDown.value); } }, 0); }, 1000); }; return { isShowSend, timeNum, countDown, }