1.0.6 • Published 5 years ago
wk-countdown v1.0.6
react的一款短信倒计时组件,有按钮型和文字型,需安装antd
使用方法:
npm i -S wk-countdown简单示例:
import CountDown from "wk-countdown";
function Test(){
  const callback = () => {
    /* 发送短信的操作 */
  }
  
  return <CountDown callback={callback}/>
}参数说明
| name | type | required | default | description | 
|---|---|---|---|---|
| callback | function | true | 如发送短信的操作 | |
| time | number | false | 60 | 倒计时多少秒 | 
| title | string | false | "获取验证码" | 用于修改按钮标题:"如重发验证码" | 
| type | string | false | 默认为antd按钮, 如需展示文字,设置type="text" | 
如:
import CountDown from "wk-countdown";
function Test(){
  let tableList = [{},{},{},{}]
  const callback = () => {
    /* 发送短信的操作 */
  }
  
  return <div>
    {
      tableList.map(item => {
        return <CountDown callback={callback} title='重发验证码' time={30} type='text'/>
      })
    }
  </div>
}问题反馈: 443028159@qq.com