0.0.6 • Published 2 years ago

react-native-rxinput v0.0.6

Weekly downloads
4
License
MIT
Repository
github
Last release
2 years ago

RXInput

Getting started

$ npm install react-native-rxinput --save

Usage

import RXTextInput, {RXNumberUtil} from 'react-native-rxinput'

// render
<RXTextInput
  type={'float'}
  enable={false}
  maxLength={5}
  onChangeText={(text) => {
    //...
  }

  //...TextInput.props
/>

根据 React-NativeTextInput 控制和过滤掉文本。

Props

  • ...TextInput.props
  • type
  • enable
  • valueSize

Reference

type

类型说明默认
text空(默认键盘)true
number数字键盘
int数字键盘 - 整型
float数字键盘 - 浮点型(最多保留2位小数)
amount金额 (8位数字 + 格式化)
phone手机 (11位数字 + 格式化)
bankCard银行卡 (19位数字 + 格式化)
VIN车架号 (17位字母+数字)
idCardNo身份证 (18位)
email邮箱
captcha验证码 (6位数字)
graphCaptcha校验图形验证码 (4位数字)
password输入的文本加密

enable

如果为false,文本框是不可编辑的。默认值为true。(等同于 editable)


valueSize

输入的文本字体大小。