@@ -35,6 +35,7 @@ export default Demo
3535``` jsx mdx:preview&background=#bebebe29
3636import React , { useState } from ' react' ;
3737import SearchInputBar from ' @uiw/react-native/lib/SearchInputBar' ;
38+ import { Button } from ' @uiw/react-native' ;
3839
3940function Demo () {
4041 const [value , setValue ] = useState (' ' )
@@ -44,8 +45,15 @@ function Demo() {
4445 onClear= {()=> setValue (' ' )}
4546 value= {value}
4647 placeholder= " 请输入搜索关键字"
47- searchRender= {< div style= {{ display: ' flex' , alignItems: ' center' }}>< label> 搜索< / label>< / div> }
48- actionName= " 搜一下"
48+ searchRender= {
49+ < Button
50+ style= {{ marginLeft: 15 , background: ' rgb(240, 244, 247)' }}
51+ textStyle= {{color: ' block' }}
52+ type= " link"
53+ >
54+ 搜索
55+ < / Button>
56+ }
4957 showActionButton
5058 / >
5159 )
@@ -57,33 +65,32 @@ export default Demo
5765### 获取输入框 Ref
5866``` jsx mdx:preview&background=#bebebe29
5967import React , { useState , Fragment , useRef } from ' react' ;
68+ import { View } from ' react-native' ;
6069import { SearchInputBar , Button } from ' @uiw/react-native' ;
6170
6271function Demo () {
6372 const inputRef = useRef ()
6473 const [value , setValue ] = useState (' ' )
6574 return (
66- < Fragment >
75+ < View >
6776 < SearchInputBar
6877 ref= {inputRef}
6978 onChangeText= {setValue}
7079 onClear= {()=> setValue (' ' )}
7180 value= {value}
7281 placeholder= " 请输入搜索关键字"
73- actionName= " 搜一下"
7482 showActionButton
75- button= {{
76- onPress () {
77- // 点击搜索按钮触法
78- }
79- }}
83+ searchRender= {
84+ < Button
85+ style= {{ marginLeft: 15 , background: ' rgb(240, 244, 247)' }}
86+ textStyle= {{color: ' block' }}
87+ type= " link"
88+ >
89+ 获取输入框Ref
90+ < / Button>
91+ }
8092 / >
81- < Button
82- onPress= {()=> {
83- console .log (inputRef .current .inputRef )
84- }}
85- > 获取 输入框 Ref< / Button>
86- < / Fragment>
93+ < / View>
8794 )
8895}
8996export default Demo
0 commit comments