Skip to content

doc: Update README.md #222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 33 commits into from
Sep 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
33be1b2
编写选项卡组件
cuilanxin Aug 9, 2021
546167b
Merge branch 'uiwjs:master' into master
cuilanxin Aug 9, 2021
6745b07
类型名称请调整,添加组件文档在网站上展示
cuilanxin Aug 10, 2021
097c003
Merge branch 'uiwjs:master' into master
cuilanxin Aug 10, 2021
34c9512
Merge branch 'uiwjs:master' into master
cuilanxin Aug 10, 2021
ba7d98d
#162修复报错
cuilanxin Aug 10, 2021
8f8f636
fix:#162修复报错
cuilanxin Aug 10, 2021
014b41e
Merge branch 'uiwjs:master' into master
cuilanxin Aug 11, 2021
c527a46
Merge branch 'uiwjs:master' into master
cuilanxin Aug 12, 2021
d5e1868
Merge branch 'uiwjs:master' into master
cuilanxin Aug 13, 2021
7666f22
SpeedDial 悬浮标记
cuilanxin Aug 13, 2021
fabb11c
优化类型
cuilanxin Aug 14, 2021
2f50aee
优化类型
cuilanxin Aug 14, 2021
4caa341
feat: Tooltip组件
cuilanxin Aug 18, 2021
1b816b4
Merge branch 'uiwjs:master' into master
cuilanxin Aug 19, 2021
1b83b97
Merge branch 'uiwjs:master' into master
cuilanxin Aug 27, 2021
6298643
Merge branch 'uiwjs:master' into master
cuilanxin Sep 4, 2021
7060c03
feat(ActionSheet): Add new component.
cuilanxin Sep 5, 2021
504acae
Merge branch 'uiwjs:master' into master
cuilanxin Sep 6, 2021
6495f4a
fix: ActionSheet 实例优化,组件优化
cuilanxin Sep 6, 2021
b8763e8
Merge branch 'uiwjs:master' into master
cuilanxin Sep 7, 2021
e787fbf
Merge branch 'uiwjs:master' into master
cuilanxin Sep 8, 2021
e4aee47
feat(SearchInputBar): Add new component.
cuilanxin Sep 8, 2021
f4826f1
Merge branch 'uiwjs:master' into master
cuilanxin Sep 9, 2021
bf8c66d
feat(Pagination): Add new component.
cuilanxin Sep 9, 2021
24de46e
Merge branch 'uiwjs:master' into master
cuilanxin Sep 10, 2021
875e6c5
fix(Tooltip): 修复cloud弹出元素位置问题
cuilanxin Sep 10, 2021
6cf91d4
Merge branch 'uiwjs:master' into master
cuilanxin Sep 10, 2021
293e07c
Merge branch 'uiwjs:master' into master
cuilanxin Sep 14, 2021
a37c701
Merge branch 'uiwjs:master' into master
cuilanxin Sep 16, 2021
96181ef
Merge branch 'uiwjs:master' into master
cuilanxin Sep 17, 2021
858069e
doc(Drawer): Update README.md
cuilanxin Sep 18, 2021
11d115f
doc: Update README.md
cuilanxin Sep 19, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/core/src/Avatar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ function Demo() {
<View style={{ flexDirection: 'row' }}>
<Avatar src="https://xx.images.com/xxx/icon.png" />
<Avatar src={uri} />
<Avatar src={require('./1.png')} />
</View>
);
}
Expand Down
69 changes: 69 additions & 0 deletions packages/core/src/Drawer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,75 @@ function Demo() {
}
```

## 注意事项 - 抽屉高度是页面有效高度
```jsx
import { Fragment } from 'react';
import { View, Text, SafeAreaView } from 'react-native';
import { Drawer, Button } from '@uiw/react-native';

function Demo() {
const [visible, setVisible] = useState(false);
return (
<SafeAreaView style={{flex: 1}}>
<Drawer
isOpen={visible}
onChange={(isOpen) => setVisible(isOpen)}
>
<View>
<Text>左边打开抽屉内容</Text>
</View>
</Drawer>
<Button onPress={() => setVisible(!visible)}>左边打开抽屉</Button>
</SafeAreaView>
);
}
```
## 抽屉覆盖全屏
- 可查看 [react-native-root-siblings](https://www.npmjs.com/package/react-native-root-siblings) 文档
```jsx
// 在 App.js 文件中
import React from 'react';
import {Provider} from 'react-redux';
import {store} from './models';
import {RootSiblingParent} from 'react-native-root-siblings';

export default () => {
return (
<Provider store={store}>
<RootSiblingParent>
{/* ...你的导航之类的组件 */}
</RootSiblingParent>
</Provider>
);
};


// 在使用组件页面
import { Fragment } from 'react';
import { View, Text, SafeAreaView } from 'react-native';
import { Drawer, Button } from '@uiw/react-native';
import {RootSiblingPortal} from 'react-native-root-siblings';

function Demo() {
const [visible, setVisible] = useState(false);
return (
<SafeAreaView>
<RootSiblingPortal>
<Drawer
isOpen={visible}
onChange={(isOpen) => setVisible(isOpen)}
>
{/* SafeAreaView 这样做是有必要的,因为手机时间是需要与内容分开的,除非你并不需要 */}
<SafeAreaView>
<Text>左边打开抽屉内容</Text>
</SafeAreaView>
</Drawer>
</RootSiblingPortal>
<Button onPress={() => setVisible(!visible)}>左边打开抽屉</Button>
</SafeAreaView>
);
}
```
## props

| 参数 | 说明 | 类型 | 默认值 |
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/Ellipsis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Ellipsis 超出省略

```jsx
import { Fragment } from 'react';
import { View, Text } from 'react-native';
import { Ellipsis } from '@uiw/react-native';

function Demo() {
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/Empty/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ class Demo extends Component {
<!--DemoStart-->
```js
import { Empty } from '@uiw/react-native';
import {View, Text } from 'react-native';

class Demo extends Component {
render() {
Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/Input/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import { View, Input } from '@uiw/react-native';
export default class BasicInputExample extends React.Component {
render() {
return <View>
<Input style={styles.input} onChange={(value) => {this.setState({value})}} value={this.state.value} />
<Input style={styles.input} extra="小数" />
<Input style={styles.input} error />
<Input style={styles.input} type="phone" />
<Input onChange={(value) => {this.setState({value})}} value={this.state.value} />
<Input extra="小数" />
<Input error />
<Input type="phone" />
</View>
}
}
Expand Down
5 changes: 1 addition & 4 deletions packages/core/src/Loader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,11 @@ function Demo() {

<!--DemoStart-->
```jsx
import { View } from 'react-native';
import { Button,Loader } from '@uiw/react-native';

function Demo() {
return (
<View style={{ minHeight: 60 }}>
<Loader color="red" />
</View>
<Loader color="red" />
);
}
```
Expand Down
8 changes: 5 additions & 3 deletions packages/core/src/MaskLayer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ MaskLayer 遮罩层

<!--DemoStart-->
```jsx
import React, { Component, Fragment } from 'react';
import { View, Text, Alert, SafeAreaView } from 'react-native';
import { Modal, Button, MaskLayer } from '@uiw/react-native';
import { Fragment } from 'react';
import { Text, SafeAreaView } from 'react-native';
import { Button, MaskLayer } from '@uiw/react-native';

export default () => {
const [visible, setVisible] = useState(true);
Expand All @@ -20,7 +20,9 @@ export default () => {
onDismiss={() => {
setVisible(false);
}}>
<SafeAreaView>
<Text style={{color: '#fff'}}>展示内容</Text>
</SafeAreaView>
</MaskLayer>
<Button
onPress={() => {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/Modal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Modal 模态框

<!--DemoStart-->
```jsx
import React, { Component, Fragment } from 'react';
import { View, Text, Alert, SafeAreaView } from 'react-native';
import { Component, Fragment } from 'react';
import { View, Text, SafeAreaView } from 'react-native';
import { Modal, Button } from '@uiw/react-native';

export default class ButtonGroupView extends Component {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/Result/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Result 结果页

```jsx
import { Text } from 'react-native';
import { Result, Icon } from '@uiw/react-native';
import { Result, Icon, Del } from '@uiw/react-native';

function Demo() {
return (
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/SearchBar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SearchBar 模糊搜素组件
## 基础示例

```jsx
import { Result, Icon } from '@uiw/react-native';
import { SearchBar } from '@uiw/react-native';

function Demo() {
return (
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/SelectCascader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ SelectCascader 级联选择
## 基础示例

```jsx
import { Text } from 'react-native';
import React, { Component } from 'react';
import { Component } from 'react';
import { SelectCascader } from '@uiw/react-native';


Expand Down
12 changes: 6 additions & 6 deletions packages/core/src/Slider/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ Slider 滑块输入条
## 基础示例

```jsx
import { Fragment } from 'react';
import { Fragment, useState } from 'react';
import { Text } from 'react-native';
import { Drawer } from '@uiw/react-native';
import { Slider } from '@uiw/react-native';

function Demo() {
const [value, setValue] = useState(0.3);
Expand All @@ -30,8 +30,8 @@ function Demo() {
## 不显示滑块

```jsx
import { Fragment } from 'react';
import { Drawer } from '@uiw/react-native';
import { Fragment,useState } from 'react';
import { Slider } from '@uiw/react-native';

function Demo() {
const [value, setValue] = useState(0.3);
Expand All @@ -50,8 +50,8 @@ function Demo() {
## 设置步长

```jsx
import { Fragment } from 'react';
import { Drawer } from '@uiw/react-native';
import { Fragment, useState } from 'react';
import { Slider } from '@uiw/react-native';

function Demo() {
const [value, setValue] = useState(0.3);
Expand Down
5 changes: 3 additions & 2 deletions packages/core/src/SpeedDial/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ SpeedDial 悬浮标记组件按下时,浮动动作按钮可以以快速显示

```jsx
import { Fragment } from 'react';
import { SpeedDial } from '@uiw/react-native';
import { SpeedDial, Icon } from '@uiw/react-native';
import { Text } from '@uiw/react-native';

function Demo() {
return (
Expand Down Expand Up @@ -42,7 +43,7 @@ function Demo() {

```jsx
import { Fragment } from 'react';
import { Rating, Icon } from '@uiw/react-native';
import { SpeedDial, Icon } from '@uiw/react-native';
function Demo() {
return (
<Fragment>
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/SwipeAction/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default class BasicSwipeActionExample extends React.Component {
onOpen={() => console.log('open')}
onClose={() => console.log('close')}
>
<View style={styles.view}>
<View>
<Text>滑动</Text>
</View>
</SwipeAction>
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/Switch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Switch 开关
## 基础示例

```jsx
import { Spacing,Flex, Switch } from '@uiw/react-native';
import { Switch } from '@uiw/react-native';

function Demo() {
return (
Expand Down Expand Up @@ -44,7 +44,7 @@ function Demo() {

```jsx
import { useState } from 'react';
import { Spacing,Flex, Switch } from '@uiw/react-native';
import { Switch } from '@uiw/react-native';

function Demo() {
const [checked, setChecked] = useState(false);
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/Tabs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function Demo() {

```jsx
import { Fragment } from 'react';
import { Rating, Icon } from '@uiw/react-native';
import { Tabs, Icon } from '@uiw/react-native';
function Demo() {
return (
<Fragment>
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/Tile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ function Demo() {
return (
<Fragment>
<Tile
imageSrc={require('../../image/tileBG.png')}
// imageSrc={{uri: 'https://img11.51tietu.net/pic/2016-071418/20160714181543xyu10ukncwf221991.jpg'}}
imageSrc={require('xxx.png')}
imageProps={{resizeMode:'contain'}}
containerStyle={{marginTop: 10}}
imageContainerStyle={{backgroundColor:'#ccc'}}
Expand Down
34 changes: 14 additions & 20 deletions packages/core/src/Tooltip/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,36 @@ Tooltip 工具提示
## 基础示例

```jsx
import { Fragment } from 'react';
import { Tooltip } from '@uiw/react-native';


function Demo() {
return (
<Fragment>
<Tooltip title='我是一个文本'>
<Text style={styles.textStyle}>我是一个文本</Text>
</Tooltip>
</Fragment>
<Tooltip title='我是一个文本'>
<Text>我是一个文本</Text>
</Tooltip>
);
}
```

## 使用 自定义提示内容

```jsx
import { Fragment } from 'react';
import { Tooltip, Icon } from '@uiw/react-native';

function Demo() {
return (
<Fragment>
<Tooltip
backgroundColor="pink"
width={30}
height={30}
title={(<View>
<Text>我是一个苹果</Text>
<Icon name='apple' color="#fff" />
</View>)}
>
<Icon name='apple' color="red" />
</Tooltip>
</Fragment>
<Tooltip
backgroundColor="pink"
width={30}
height={30}
title={(<View>
<Text>我是一个苹果</Text>
<Icon name='apple' color="#fff" />
</View>)}
>
<Icon name='apple' color="red" />
</Tooltip>
);
}
```
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/TransitionImage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ TransitionImage 图像
## 基础示例

```jsx
import { Fragment, ActivityIndicator } from 'react';
import { Fragment } from 'react';
import { TransitionImage } from '@uiw/react-native';
import {ActivityIndicator} from 'react-native';


function Demo() {
Expand All @@ -34,7 +35,6 @@ function Demo() {

```ts
import { ImageProps } from 'react-native';
import { TransitionImage } from '@uiw/react-native';

export interface TransitionImage extends ImageProps{
/* 按下组件时的回调函数 */
Expand Down
12 changes: 0 additions & 12 deletions packages/core/src/Typography/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,6 @@ function Demo() {
}
```

## 段落

```jsx
import { P } from '@uiw/react-native';

function Demo() {
return (
<P>这段文字加粗</P>
);
}
```

## 换行

```jsx
Expand Down