# time_cutdown_component

> React倒计时组件

Latest version **1.0.6** (published 2018-06-26) · ISC license · 0 weekly downloads

## Install

```sh
npm install time_cutdown_component
pnpm add time_cutdown_component
yarn add time_cutdown_component
bun add time_cutdown_component
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2018-06-26 |
| First published | 2018-06-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | firstleapreact |

## Links

- npm: https://www.npmjs.com/package/time_cutdown_component
- npm.io page: https://npm.io/package/time_cutdown_component

## Recent versions

- 1.0.6 (latest) — 2018-06-26
- 1.0.5 — 2018-06-26
- 1.0.4 — 2018-06-26
- 1.0.3 — 2018-06-26
- 1.0.2 — 2018-06-26
- 1.0.1 — 2018-06-26

## README

# CenterCascader

 React倒计时组件

### Screenshots

![image](./pic/cut_down.img.png)

# Explain

 * 这是一款适用于PC 移动端的组件，目的在于获取计算天数，减少去网上copy代码的时间。

### Install

```
npm i --save time_cutdown_component
```

### Usage
```
  import CountDown from '../../component/CountDown';

```

```
   <CountDown time={"2019-02-10"} 
              value={(v,day,hour,minute) => {
                this.setState({ pCutDown: v })
              }}>
              trigger={(day,hour,minute)=>{
                action.trigger({})
              }}
  </CountDown>

```

# API

### props


name | type | default  | description | Required
---|---|---|---|---
time | String | - | 传入截止的日期 | Yes
value | Function | - | 回掉函数，用于将计算好的倒计时返回 | Yes
trigger | Function | - | 回掉函数,当天数=0,小时=0,分钟=0时，可以触发事件 | No

# 注意事项

 * value,trigger 回调函数，参数说明 

    v : 228d 08hr 59min 

    day : 228

    hour : 08

    minute : 59
 
 * 调用组件时返回值可能会出现, unfined, 因为dom渲染时，还没获取到截止日期，没有传到组件。

  解决方案

    ```
    {截止日期 ? <CountDown 
                    time={"2019-02-10"} 
                    value={(v) => {
                    this.setState({ pCutDown: v })
                  }}>
            </CountDown> : null}
    ```

---
_Source: https://npm.io/package/time_cutdown_component · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
