Counter

Counter

new对象时可传入计数

Constructor

new Counter(argCount, argCb)

Source:
Author:
  • linjielinlin 993353454@qq.com
Example
const counter = new Counter(60, () => {})
counter.stop()
counter.setCount(60)
counter.start()
Parameters:
Name Type Default Description
argCount number 60

开始计时秒数

argCb function

回调函数

Methods

setCount(argCount)

Description:
  • 设置当前倒计时数值

Source:
Parameters:
Name Type Default Description
argCount number 60

当前倒计时数值

setMaxCount(argCount)

Description:
  • 设置初始倒计时数值

Source:
Parameters:
Name Type Default Description
argCount number 60

初始倒计数

start(argCb)

Description:
  • 开始倒计时

Source:
Parameters:
Name Type Description
argCb function

计时回调,返回当前剩余秒数

stop()

Description:
  • 停止倒计时

Source: