🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

rc-countdown-view

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-countdown-view

A simple countdown react component.

Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
4
-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

rc-countdown-view

一个简单的 react 倒计时组件。

查看示例

安装

npm install rc-countdown-view
# or
yarn install rc-countdown-view

示例

import React from 'react';
import CountDown from 'rc-countdown-view';

export default () => {
  return (
    <CountDown time={10 * 60 * 60 * 1000} />
  )
}

API

参数说明类型默认值
time倒计时,单位毫秒number0
interval时间间隔,单位毫秒number1000
format时间格式化。如果传入 string,DD-日,HH-时,mm-分,ss-秒,SSS-毫秒。如果传入 function,必须要有返回值 (timestamp)=>anystring functionHH:mm:ss
autoStart自动开始booleantrue
onChange时间变化时触发 (time)=>voidfunction-
onEnd倒计时结束时触发function-
ref当需要手动控制时,传入 useRef 将在 ref.current 扩展三个方法:start pause reset--

Keywords

countdown

FAQs

Package last updated on 18 May 2020

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