An open API service indexing awesome lists of open source software.

https://github.com/realgeoffrey/react-time-countdown

倒计时(React组件)
https://github.com/realgeoffrey/react-time-countdown

countdown-timer countdowntimer react

Last synced: about 1 year ago
JSON representation

倒计时(React组件)

Awesome Lists containing this project

README

          

# react-time-countdown

React的倒计时组件

1. npm:
2. demo:

### 安装-引用
1. Node.js

```shell
npm install react-time-countdown --save
```

```tsx
import TimeCountdown from 'react-time-countdown'
```
2. 浏览器

```html


const TimeCountdown = window['react-time-countdown'].default

```

### 用法

```tsx
{
// 倒计时结束时执行的回调函数
}}
leftMillisecond={提前到期的毫秒数(0)}
renderMillisecond={(millisecond: number): React.ReactNode => {
// 参数:倒计时还剩下多少毫秒
// 返回:渲染本组件
}}
intervalDelay={每次调用渲染的间隔时间,毫秒(1000)}
/>
```

### 开发调试
```shell
# 监听改变
yarn start

# 运行开发demo
cd dev
yarn start
```

```shell
# 构建生产环境文件
yarn build
```