3.0.0 • Published 5 months ago

rc-countdown-view v3.0.0

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

rc-countdown-view

npm GitHub

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

查看示例

安装

npm install rc-countdown-view
yarn add rc-countdown-view
pnpm add 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-
actionRef常用操作,开始/暂停/重置MutableRefObject<ActionType>-
3.0.0

5 months ago

2.0.2

11 months ago

2.1.0

11 months ago

2.0.1

2 years ago

2.0.0

3 years ago

1.2.1

4 years ago

1.2.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.0

5 years ago