Skip to content

Countdown 倒计时

用于展示剩余时间。

js
import { Countdown } from '@kupola/components/countdown'

const countdown = Countdown({
  target: Date.now() + 60_000,
  onFinish: () => console.log('完成'),
})

document.body.appendChild(countdown.element)

常用选项

选项说明
target目标时间
format显示格式
onFinish完成回调

方法

  • start()
  • stop()
  • destroy()