Skip to content

useCountdown

创建一个倒计时

演示

示例

vue
<template>
  {{ 
output
}}
</template> <script lang="ts" setup> import {
useCountdown
} from '@mixte/use';
import {
onMounted
} from 'vue';
const {
output
,
isStart
,
start
,
stop
} =
useCountdown
(60, {
duration
: 60 * 1000,
});
onMounted
(() => {
start
();
}); </script>

Released under the MIT License.