haoxuan
2023-11-18 b0f14528e49fcfb6d486bf1e920f0457cbac6049
src/common/composable/useCountDown.ts
@@ -19,7 +19,7 @@
}
function useCountDown(seconds: number, options?: Options) {
  const timer = new StepTimer(seconds * 1000, 1000)
  let timer = new StepTimer(seconds * 1000, 1000)
  const remainingSeconds = ref<number>(seconds)
@@ -65,6 +65,12 @@
    timer.abort()
  }
  function reset() {
    timer.destroy()
    remainingSeconds.value = seconds
    timer = new StepTimer(seconds * 1000, 1000)
  }
  return {
    startCountdown,
    remainingSeconds,
@@ -72,7 +78,8 @@
    continueCountdown,
    stopCountdown,
    formattedTime,
    countdownStatus
    countdownStatus,
    reset
  }
}