@jeff-tian/react-codebox
v0.3.1
Published
codebox component for react
Downloads
6
Readme
react-codebox
验证码输入框的 React 实现.
Install
yarn add @jeff-tian/react-codebox
或者
npm i @jeff-tian/react-codebox --save
Usage
import React, { Component } from "react";
import Codebox from "@jeff-tian/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