React 实现车牌键盘的示例代码
时间:2021-09-22 07:10:10|栏目:JavaScript代码|点击: 次
vehicle-plate-keyboard
React 实现的车牌键盘。
https://github.com/LiuuY/vehicle-plate-keyboard
💡 Features
省份 + 字母/数字 + '港澳学警领'
新能源车牌
自动判断当前位置可输入字符类型
🚗 Demo
Demo
📷 Screenshots
📦 Installation
yarn add vehicle-plate-keyboard
🔨 Usage
import LicenseKeyboard from 'vehicle-plate-keyboard'; import 'vehicle-plate-keyboard/dist/main.css'; ... <LicenseKeyboard visible={state.showKeyboard} onChange={value => setState({ value })} value={state.value} done={() => setState({ showKeyboard: false })} />
API
props | type | description |
---|---|---|
visiable | boolean | keyboard visible |
onChange | (value: string) => void | trigger when user tap |
value | string | controlled value |
done | () => void | trigger when keyborad dismiss |
confirmButtonStyle | React.CSSProperties | confirm button style |
confirmButtonText | string | confirm button text |
cellTextStyle | React.CSSProperties | keycell style |
safeArea | boolean | show safearea |
📝 License
MIT License
上一篇:JS也玩OO继承
栏 目:JavaScript代码
本文标题:React 实现车牌键盘的示例代码
本文地址:http://www.codeinn.net/misctech/176662.html