1.0.0 • Published 3 years ago
easy-react-captcha v1.0.0
react-codebox
验证码输入框的 React 实现.
Install
yarn add @axetroy/react-codebox
Usage
import React, { Component } from "react";
import Codebox from "@axetroy/react-codebox";
class App extends Component {
render() {
return (
<div>
<Codebox
type="text"
length={4}
validator={(input, index) => {
return /\d/.test(input);
}}
onChange={codeArray => {
console.log(codeArray);
}}
/>
</div>
);
}
}
License
The MIT License
1.0.0
3 years ago