haoxuan
2023-11-01 8c84c7277018b259f5b99f26cbfd14603bc4e4c0
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
  }
}