@@ -66,59 +66,27 @@ export default Demo
6666
6767### Props
6868
69- ``` tsx
70- import { StyleProp ,TextStyle ,TextInputProps , NativeSyntheticEvent , TextInputFocusEventData , TextInputChangeEventData , KeyboardTypeOptions ,ViewStyle } from ' react-native'
71-
72- export interface InputProps extends TextInputProps {
73-
74- /** 唤起键盘类型 详情 https://lefkowitz.me/visual-guide-to-react-native-textinput-keyboardtype-options/ */
75- keyboardType? : KeyboardTypeOptions ;
76- /** 如果为 true,文本框是不可编辑的。默认值为 false */
77- disabled? : boolean ;
78- /** 如果为 true,在componentDidMount后会获得焦点。默认值为 false。 */
79- autoFocus? : boolean ;
80- /** 设置输入框高亮时的颜色(还包括光标)。 */
81- selectionColor? : string ;
82- /** 如果为 true,则隐藏光标。默认值为 false。 */
83- caretHidden? : boolean ;
84- /** 是否显示清除按钮 */
85- clear? : boolean ;
86- /** 清除按钮样式 */
87- clearStyle? : StyleProp <TextStyle >;
88- /** 自定义清除元素 */
89- renderClear? : React .ReactNode ;
90- /** 如果为 true,每次开始输入的时候都会清除文本框的内容。 */
91- clearText? : boolean ;
92- /** 输入框前缀的额外的信息 */
93- extraStart? : string | React .ReactNode
94- /** 输入框末尾额外的信息 */
95- extraEnd? : string | React .ReactNode
96- /** 当文本框内容变化时调用此回调函数。改变后的文字内容会作为参数传递 */
97- onChangeText? : ((text : string ) => void );
98- /** 当文本框失去焦点的时候调用此回调函数。 */
99- onBlur? : ((e : NativeSyntheticEvent <TextInputFocusEventData >) => void );
100- /** 当文本框内容变化时调用此回调函数。回调参数为{ nativeEvent: { eventCount, target, text} }。 */
101- onChange? : ((e : NativeSyntheticEvent <TextInputChangeEventData >) => void );
102- /** 输入框 ref */
103- inputRef? : React .RefObject <TextInput >
104- }
105-
106- ```
69+ > 更多 react-native Input 属性请参考 react-native TextInput (https://www.react-native.cn/docs/textinput )
10770
10871| 参数 | 说明 | 类型 | 默认值 |
10972| ------| ------| -----| ------|
11073| ` value ` | 输入框默认值 | string | - |
11174| ` rule ` | 限制输入条件 | RegExp | - |
11275| ` wrongfulHandle ` | 输入不合法时触发方法 | Function | - |
113- | ` maxLength ` | 限制文本框中最多的字符数 | number | - |
114- | ` placeholder ` | 如果没有任何文字输入,会显示此字符串 | string | - |
115- | ` style ` | 输入框样式 | ` StyleProp<TextStyle> ` | - |
116- | ` containerStyle ` | 容器样式 | ` StyleProp<ViewStyle> ` | - |
76+ | ` disabled ` | 文本框是否可编辑 | boolean | - |
77+ | ` clearText ` | 如果为 true,每次开始输入的时候都会清除文本框的内容。 | boolean | - |
11778| ` error ` | 显示错误 | boolean | - |
11879| ` renderError ` | 自定义错误提示 | React.ReactNode | - |
11980| ` border ` | 边框 | `'bottom'| 'top'| 'left'| 'right'| null| 'always'` | - |
12081| ` borderColor ` | 边框颜色 | string | - |
121- | ` keyboardType ` | 唤起键盘类型 | KeyboardTypeOptions | - |
122-
82+ | ` clear ` | 是否显示清除按钮 | boolean | - |
83+ | ` clearStyle ` | 清除按钮样式 | StyleProp<` TextStyle ` > | - |
84+ | ` renderClear ` | 自定义清除元素 | React.ReactNode | - |
85+ | ` extraStart ` | 输入框前缀的额外的信息 | string \| React.ReactNode | - |
86+ | ` extraEnd ` | 输入框末尾额外的信息 | string \| React.ReactNode | - |
87+ | ` inputRef ` | 输入框ref | React.RefObject<` TextInput ` > | - |
88+ | ` maxLength ` | 限制文本框中最多的字符数 | number | - |
89+ | ` placeholder ` | 如果没有任何文字输入,会显示此字符串 | string | - |
90+ | ` style ` | 输入框样式 | ` StyleProp<TextStyle> ` | - |
91+ | ` containerStyle ` | 容器样式 | ` StyleProp<ViewStyle> ` | - |
12392
124- > 更多 react-native Input 属性请参考 react-native TextInput (https://www.react-native.cn/docs/textinput)
0 commit comments