npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

rn-countdown-btn

v1.0.0

Published

倒计时按钮组件

Downloads

4

Readme

项目说明

2020/06/29 12:22 by lixingru 博客地址:https://www.cnblogs.com/itgezhu/p/12809681.html

目录结构描述
rn-countdown-btn
├── Readme.md                   // help
├── countDownButton.js          // 入口文件
└── package.json                // 记录项目信息文件
环境依赖(当前使用)
react-native 0.55.4
npm 6.9.0(*用于下载包*)
下载安装
1.运行 npm install rn-countdown-btn --save
安装的同时,将信息写入package.json中项目路径dependencies字段中,如果有package.json文件时,直接使用npm install方法就可以根据dependencies配置安装所有的依赖包,这样代码提交到github时,就不用提交node_modules这个文件夹了。

2.检查项目中根目录的node_modules里是否已有rn-countdown-btn文件夹,如果有代表已经下载安装成功,接下来可以引用了
使用例子
1. 在需要使用验证码倒计时按钮的页面引用
import CountDownButton from '../child/countDownButton';

2、在render中使用countDownButton

// 在调用倒计时获取验证码方法
_getCode = ()=>{
        if(符合条件){
            this.refs.countDown._countDownAction();//请求成功并后台验证通过后调用倒计时组件的方法开始倒计时
        }else{
            this.refs.countDown._prevent();//条件不匹配或者网络错误的时候阻止倒计时
        }
}

render(){
    return(
        <View style={styles.infoItem}>
            <Text style={{flex:1.9,fontSize:16,lineHeight:50,textAlign:'left',}}>验证码</Text>
            <View style={{flex:5,flexDirection:'row',}}>
                <TextInput
                    underlineColorAndroid='transparent'
                    placeholder='请输入验证码'
                    // placeholderTextColor="#e1e1e1"
                    onEndEditing={(event) => this.updateText(
                                                event.nativeEvent.text,'verificationCode'
                                            )}
                    keyboardType='numeric'
                    maxLength={6}
                    defaultValue={verificationCode}
                    style={{height:45,fontSize:16,textAlign:'center',paddingLeft:10,paddingRight:10,flex:1,borderRadius:3,backgroundColor:'#f0f0f0',}}
                ></TextInput>
                < CountDownButton
                    style={{marginLeft:10,backgroundColor:'#fff',borderRadius:6,borderWidth:1,borderColor:'#999998',width:100}}
                    textStyle={{paddingLeft:5,paddingRight:5, color: '#fff',fontSize: 14,lineHeight:42,textAlign:'center',color:'#000'}}
                    timerCount={30}//设置倒计时长
                    timerTitle={'获取验证码'}//设置按钮默认标题
                    onClick={this._getCode}
                    ref="countDown"
                    />
            </View>
        </View>
    )
}