InputItem
单行文本输入
Basic Example
Props
| 属性 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| type | 可以是银行卡bankCard; 手机号phone(此时最大长度固定为11,maxLength设置无效); 密码password; 数字number(为了尽量唤起带小数点的数字键盘,此类型并不是原生 number,而是<input type="text" pattern="[0-9]*" />); digit(表示原生的 number 类型); 以及其他标准 input type 类型 | String | text |
| value | value 值(受控与否参考https://facebook.github.io/react/docs/forms.html) | String | 无 |
| defaultValue | 设置初始默认值 | String | - |
| placeholder | placeholder | String | '' |
| placeholderTextColor | placeholderTextColor | String | theme.color_text_placeholder |
| editable | 是否可编辑 | bool | true |
| disabled | 是否禁用 | bool | true |
| autoFocus | 是否禁用 | bool | true |
| clear | 是否带清除功能(仅editable为true,disabled为false才生效)。在 Android 中, 处于编辑状态(focus)时 icon 才会出现, 且此组件被ScrollView包裹时, 设置ScrollView的keyboardShouldPersistTaps属性为handled或always时, icon才会正确响应点击事件 | bool | false |
| maxLength | 最大长度 | number | 无 |
| textAlign | 输入框的位置,可选值有 left 和 right | string | right |
| onChange | change 事件触发的回调函数 | (val: string): void | - |
| onBlur | blur 事件触发的回调函数 | (val: string): void | - |
| onFocus | focus 事件触发的回调函数 | (val: string): void | - |
| labelNumber | 标签的文字个数,可用2-7之间的数字 | number | 5 |
| last | 如果是最后一项,则将移除borderBottom(默认拥有borderBottom) | bool | false |