1.0.4 • Published 9 months ago

countdownjs-plugin v1.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

v1.0.0

倒计时组件,传入4个参数,开始时间,结束时间,倒计中回调,结束回调

安装

    npm install countdownjs-plugin

使用

    import Countdown from 'countdownjs-plugin';

    // 创建倒计时1
    const countdown1 = new Countdown(
      new Date('2023-08-16T12:00:00').getTime(),
      new Date('2023-08-16T13:00:00').getTime(),
      (time) => {
        console.log('倒计时1:', time);
      },
      () => {
        console.log('倒计时1 结束');
      }
    );

    // 创建倒计时2
    const countdown2 = new Countdown(
      new Date('2023-08-1T12:00:00').getTime(),
      new Date('2023-08-16T13:00:00').getTime(),
      (time) => {
        console.log('倒计时2:', time);
      },
      () => {
        console.log('倒计时2 结束');
      }
    );


    // 停止倒计时1和2
    countdown1.stop();
    countdown2.stop();
属性名是否必填说明
startTime开始时间的时间戳
endTime结束的时间戳
onTick倒计时中回调
onEnd结束回调
1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago