New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

light-countdown

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

light-countdown

countdown plugin

latest
Source
npmnpm
Version
1.0.5
Version published
Maintainers
1
Created
Source

Build Status Coverage Status Github Releases Github License

倒计时组件

安装

$ npm install light-countdown --save

用法


import countdown from 'light-countdown';

// 简单用法
countdown({
    timeEnd: (new Date().getTime() + 100000),
    selector: '#example'
});

// 所有参数
countdown({
    currentTime: new Date('2018-4-15 20:00:00').getTime(),
    timeEnd: new Date('2018-4-15 20:00:05').getTime(),
    selector: '#example2',
    msgPattern: '{years}年{months}月{weeks}周{days}天{hours}时{minutes}分{seconds}秒{decimal}',
    showZero: false, // 小于10补0,默认为true
    afterCount() {
        alert('done')
    }
});

文档

countdown

参数:

  • currentTime: 当前时间,默认值new Date().getTime(),为了防止客户端时间不一致,建议传入服务器时间
  • timeEnd: 倒计时结束时间,默认值new Date().getTime()
  • selector: 包含倒计时文案的标签,默认值.J_countdown
  • mspPattern: 倒计时的展示格式,默认值{days}天{hours}时{minutes}分{seconds}秒{decimal}
  • showZero: 小于10的数字是否补0,默认值true
  • afterCount: 倒计时结束回调函数,默认为空函数

返回值:undefined

LICENSE

MIT

Keywords

countdown

FAQs

Package last updated on 16 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts