2.0.1 • Published 12 months ago

rc-countdown-view v2.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
12 months ago

rc-countdown-view

npm GitHub

一个简单倒计时 react 组件。

查看示例

安装

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

示例

import CountDown from 'rc-countdown-view';

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

API

除了以下属性,还支持 span 标签的其他属性。

参数说明类型默认值
time倒计时,单位毫秒number0
interval时间间隔,单位毫秒number1000
format格式化。如果传入 string 将自动转换 DD-日,HH-时,mm-分,ss-秒,SSS-毫秒如果传入 function,必须要有返回值 string 且不会自动转换。string \| (timestamp: number, formatRes: { days: number, hours: number, minutes: number, seconds: number, milliseconds: number }) => voidHH:mm:ss
autoStart自动开始booleantrue
onChange时间变化时触发,参数是 format 的返回值。(formatTime: string) => void-
onEnd倒计时结束时触发() => void-
ref常用操作,开始/暂停/重置ActionType-
2.0.1

12 months ago

2.0.0

2 years ago

1.2.1

3 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.0

4 years ago