varifycode
v0.3.0
Published
a react verification code component
Downloads
15
Readme
This project was bootstrapped with Create React App.
#varifycode
npm install varifycode --save-dev
Usage
- context: PropTypes.string,
define verification-code's range, defalut:'abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPRSTUVWXYZ23456789'
- width: PropTypes.number,
- height: PropTypes.number,
- onChange: PropTypes.func.isRequired,
make the parent get the generated code,
...
<VarifyCode
context={'abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPRSTUVWXYZ23456789'} //生成验证码的范围
width={100} height={30}
onChange={(code) => console.log(code)} //父级获得验证码
/>