Skip to content

Commit 923e471

Browse files
committed
docs(SearchInputBar): 搜索栏组件文档重构
1 parent 4c41ed2 commit 923e471

File tree

2 files changed

+21
-15
lines changed

2 files changed

+21
-15
lines changed

packages/core/src/SearchInputBar/README.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,14 @@ function Demo() {
4444
onClear={()=>setValue('')}
4545
value={value}
4646
placeholder="请输入搜索关键字"
47-
searchRender={<div style={{ display:'flex', alignItems:'center' }}><label>搜索</label></div>}
48-
actionName="搜一下"
47+
searchRender={
48+
<div
49+
style={{ display:'flex', alignItems:'center', padding: '0px 16px 0px 16px' }}
50+
>
51+
<label>搜索</label>
52+
</div>
53+
}
54+
// actionName="搜一下"
4955
showActionButton
5056
/>
5157
)
@@ -57,33 +63,33 @@ export default Demo
5763
### 获取输入框 Ref
5864
```jsx mdx:preview&background=#bebebe29
5965
import React, { useState, Fragment, useRef } from 'react';
66+
import { View } from 'react-native';
6067
import { SearchInputBar, Button } from '@uiw/react-native';
6168

6269
function Demo() {
6370
const inputRef = useRef()
6471
const [value, setValue] = useState('')
6572
return (
66-
<Fragment>
73+
<View>
6774
<SearchInputBar
6875
ref={inputRef}
6976
onChangeText={setValue}
7077
onClear={()=>setValue('')}
7178
value={value}
7279
placeholder="请输入搜索关键字"
80+
searchRender={
81+
<Button
82+
style={{ marginLeft: 20 }}
83+
type="light"
84+
onPress={()=>{
85+
console.log(inputRef.current.inputRef)
86+
}}
87+
>获取 输入框 Ref</Button>
88+
}
7389
actionName="搜一下"
7490
showActionButton
75-
button={{
76-
onPress() {
77-
// 点击搜索按钮触法
78-
}
79-
}}
8091
/>
81-
<Button
82-
onPress={()=>{
83-
console.log(inputRef.current.inputRef)
84-
}}
85-
>获取 输入框 Ref</Button>
86-
</Fragment>
92+
</View>
8793
)
8894
}
8995
export default Demo

packages/core/src/Tooltip/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function Demo() {
4141
</div>
4242
)}
4343
>
44-
<Icon name='apple' color="red" />
44+
<Icon name='apple' color="#035bb6" />
4545
</Tooltip>
4646
);
4747
}

0 commit comments

Comments
 (0)