Skip to content

Commit 91c8a9f

Browse files
committed
[5.2.0-rc.1]update REAME.md
1 parent 1f1a709 commit 91c8a9f

File tree

12 files changed

+92
-35
lines changed

12 files changed

+92
-35
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ yarn add @ant-design/react-native
6262
### Installing peer dependencies
6363

6464
```bash
65-
npm install @ant-design/icons-react-native react-native-gesture-handler react-native-reanimated
65+
npm install @react-native-community/segmented-control @react-native-community/slider @ant-design/icons-react-native react-native-gesture-handler
6666
```
6767

6868
or
6969

7070
```bash
71-
yarn add @ant-design/icons-react-native react-native-gesture-handler react-native-reanimated
71+
yarn add @react-native-community/segmented-control @react-native-community/slider @ant-design/icons-react-native react-native-gesture-handler
7272
```
7373

7474
> You need go to ios folder and run `pod install` (auto linking),Android will handle it by itself.

README.zh-CN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ yarn add @ant-design/react-native
5858
### 安装peer依赖
5959

6060
```bash
61-
npm install @ant-design/icons-react-native react-native-gesture-handler react-native-reanimated
61+
npm install @react-native-community/segmented-control @react-native-community/slider @ant-design/icons-react-native react-native-gesture-handler
6262
```
6363

6464
or
6565

6666
```bash
67-
yarn add @ant-design/icons-react-native react-native-gesture-handler react-native-reanimated
67+
yarn add @react-native-community/segmented-control @react-native-community/slider @ant-design/icons-react-native react-native-gesture-handler
6868
```
6969

7070
> 安装完依赖后需要到 iOS 目录 `pod install`(auto linking),Android 不需要手动处理

components/segmented-control/index.en-US.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,28 @@ title: SegmentedControl
55
subtitle: (deprecated)
66
---
77

8-
Deprecated since `5.2.0`.
8+
Will be deprecated in `5.2.0`.
99

10-
Please use [@react-native-community/segmented-control](https://github.com/react-native-community/segmented-control#usage) instead.
10+
Please use [@react-native-community/segmented-control](https://github.com/react-native-community/segmented-control#usage) instead.
11+
12+
------
13+
14+
`SegmentedControl` includes at least two segments, it is used to display diffrent views and recommended by `iOS`.
15+
16+
### Rule
17+
- It is similar to the functionality used for `Tabs`, so avoid to use them at same page as much as possible.
18+
- You can use `SegmentedControl` with `NavBar` to display mutiple views.
19+
- Generally there should be no more than 5 segments in one line, each segment has 2-4 words and needs simplified texts.
20+
- Keep the length of the text consistent as much as possible.
21+
22+
## API
23+
24+
Properties | Descrition | Type | Default
25+
-----------|------------|------|--------
26+
| style | style of component | Object | `{}` |
27+
| tintColor | accent color of the control | String | `#2DB7F5` |
28+
| disabled | whether the user is able to interact with the control | Boolean | false |
29+
| selectedIndex | the index in `props.values` of the segment to be (pre)selected | Number | 0 |
30+
| values | The labels for the control's segment buttons, in order | array | [] |
31+
| onChange | callback that is called when the user taps a segment; passes the event object as an argument. `e.nativeEvent.selectedSegmentIndex` is selected index. `e.nativeEvent.value` is selected value. | (e): void | function(){} |
32+
| onValueChange | callback that is called when the user taps a segment; passes the segment's value as an argument | (val): void | function(){} |

components/segmented-control/index.zh-CN.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,29 @@ title: SegmentedControl
55
subtitle: 分段器(已弃用)
66
---
77

8-
`5.2.0`开始已弃用
8+
即将从`5.2.0`中弃用
99

1010
请使用[@react-native-community/segmented-control](https://github.com/react-native-community/segmented-control#usage)替代。
11+
12+
-----
13+
14+
由至少 2 个分段控件组成,用作不同视图的显示;是 iOS 的推荐组件。
15+
16+
### 规则
17+
- 和 Tabs 功能相似,尽可能避免一个页面中同时出现这两个组件。
18+
- 可以搭配 NavBar 一起使用,用于显示多个视图,分段数一般为 2 个。
19+
- 单独放置一行时,分段数最多为 5 个;文案需要精简,一般 2-4 个字。
20+
- 尽可能保持文案长度一致。
21+
22+
## API
23+
24+
属性 | 说明 | 类型 | 默认值
25+
----|-----|------|------
26+
| style | 自定义样式 | Object | `{}` |
27+
| tintColor | 组件主色调 | String | `#2DB7F5` |
28+
| disabled | 是否启用 | Boolean | false |
29+
| selectedIndex | 选中项在数组中的索引 | Number | 0 |
30+
| values | 选项数组,值是字符串 | array | [] |
31+
| onChange | 回调函数, 其中`e.nativeEvent.selectedSegmentIndex`是选中项索引, `e.nativeEvent.value`是选中的值. | (e): void | function(){} |
32+
| onValueChange | 回调函数 | (val): void | function(){} |
33+

components/slider/index.en-US.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
category: Components
33
type: Data Entry
44
title: Slider
5+
version: 5.2.0-rc.1
56
---
67

78
A Slider component for selecting particular value in range, eg: controls the display brightness of the screen.
@@ -12,17 +13,19 @@ A Slider component for selecting particular value in range, eg: controls the dis
1213

1314
## API
1415

15-
| Properties | Description | Type | Default |
16-
| --- | --- | --- | --- |
17-
| defaultValue | Default value | `number \| [number, number]` | `range ? [0, 0] : 0` |
18-
| disabled | Whether disabled | `boolean` | `false` |
19-
| icon | The icon of slider | `ReactNode` | - |
20-
| marks | Tick marks | `{ [key: number]: React.ReactNode }` | - |
21-
| max | Max value | `number` | `100` |
22-
| min | Min value | `number` | `0` |
23-
| onAfterChange | Consistent with the trigger timing of `touchend`, pass the current value as a parameter | `(value: number \| [number, number]) => void` | - |
24-
| onChange | Triggered when the slider is dragged, and the current dragged value is passed in as a parameter | `(value: number \| [number, number]) => void` | - |
25-
| range | Whether it is a double sliders | `boolean` | `false` |
26-
| step | Step distance, the value must be greater than `0`, and `(max-min)` can be divisible by `step`. When `marks` is not null, the configuration of `step` is invalid | `number` | `1` |
27-
| ticks | Whether to display the scale | `boolean` | `false` |
28-
| value | Current value | `number \| [number, number]` | - |
16+
| Properties | Description | Type | Default | Version |
17+
| --- | --- | --- | --- | --- |
18+
| defaultValue | Default value | `number` \|<br/> `[number, number]` | `range ? [0, 0] : 0` | |
19+
| disabled | Whether disabled | `boolean` | `false` | |
20+
| icon | The icon of slider | `ReactNode` | - | |
21+
| marks | Tick marks | `{ [key: number]: React.ReactNode }` | - | `5.2.0` |
22+
| max | Max value | `number` | `100` | |
23+
| min | Min value | `number` | `0` | |
24+
| onAfterChange | Consistent with the trigger timing of `touchend`, pass the current value as a parameter | `(value: number | [number, number]) => void` | - | |
25+
| onChange | Triggered when the slider is dragged, and the current dragged value is passed in as a parameter | `(value: number | [number, number]) => void` | - | |
26+
| range | Whether it is a double sliders | `boolean` | `false` | `5.2.0` |
27+
| step | Step distance, the value must be greater than `0`, and `(max-min)` can be divisible by `step`. When `marks` is not null, the configuration of `step` is invalid | `number` | `1` | `5.2.0` |
28+
| ticks | Whether to display the scale | `boolean` | `false` | `5.2.0` |
29+
| value | Current value | `number` \|<br/> `[number, number]` | - | |
30+
31+
> The returned `value` format is `[number, number]` when `range={true}`, otherwise it is `number`.

components/slider/index.zh-CN.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ category: Components
33
type: Data Entry
44
title: Slider
55
subtitle: 滑动输入条
6+
version: 5.2.0-rc.1
67
---
78

89
允许用户在一个区间中选择特定值,eg:控制屏幕的显示亮度。
@@ -13,17 +14,19 @@ subtitle: 滑动输入条
1314

1415
## API
1516

16-
| 属性 | 说明 | 类型 | 默认值 |
17-
| --- | --- | --- | --- |
18-
| defaultValue | 默认值 | `number \| [number, number]` | `range ? [0, 0] : 0` |
19-
| disabled | 是否禁用 | `boolean` | `false` |
20-
| icon | 滑块的图标 | `ReactNode` | - |
21-
| marks | 刻度标记 | `{ [key: number]: React.ReactNode }` | - |
22-
| max | 最大值 | `number` | `100` |
23-
| min | 最小值 | `number` | `0` |
24-
| onAfterChange |`touchend` 触发时机一致,把当前值作为参数传入 | `(value: number \| [number, number]) => void` | - |
25-
| onChange | 拖拽滑块时触发,并把当前拖拽的值作为参数传入 | `(value: number \| [number, number]) => void` | - |
26-
| range | 是否为双滑块 | `boolean` | `false` |
27-
| step | 步距,取值必须大于 `0`,并且 `(max - min)` 可被 `step` 整除。当 `marks` 不为空对象时,`step` 的配置失效 | `number` | `1` |
28-
| ticks | 是否显示刻度 | `boolean` | `false` |
29-
| value | 当前值 | `number \| [number, number]` | - |
17+
| 属性 | 说明 | 类型 | 默认值 | 版本 |
18+
| --- | --- | --- | --- | --- |
19+
| defaultValue | 默认值 | `number` \|<br/> `[number, number]` | `range ? [0, 0] : 0` | |
20+
| disabled | 是否禁用 | `boolean` | `false` | |
21+
| icon | 滑块的图标 | `ReactNode` | - | |
22+
| marks | 刻度标记 | `{ [key: number]: React.ReactNode }` | - | `5.2.0` |
23+
| max | 最大值 | `number` | `100` | |
24+
| min | 最小值 | `number` | `0` | |
25+
| onAfterChange |`touchend` 触发时机一致,把当前值作为参数传入 | `(value: number | [number, number]) => void` | - | |
26+
| onChange | 拖拽滑块时触发,并把当前拖拽的值作为参数传入 | `(value: number | [number, number]) => void` | - | |
27+
| range | 是否为双滑块 | `boolean` | `false` | `5.2.0` |
28+
| step | 步距,取值必须大于 `0`,并且 `(max - min)` 可被 `step` 整除。当 `marks` 不为空对象时,`step` 的配置失效 | `number` | `1` | `5.2.0` |
29+
| ticks | 是否显示刻度 | `boolean` | `false` | `5.2.0` |
30+
| value | 当前值 | `number` \|<br/> `[number, number]` | - | |
31+
32+
> `range={true}` 时返回的 `value` 格式为 `[number, number]` ,否则为 `number`

components/stepper/index.en-US.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
category: Components
33
type: Data Entry
44
title: Stepper
5+
version: 5.2.0-rc.1
56
---
67

78
`Stepper` can be used to increase or decrease value step by step.

components/stepper/index.zh-CN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ category: Components
33
type: Data Entry
44
title: Stepper
55
subtitle: 步进器
6+
version: 5.2.0-rc.1
67
---
78

89
用作增加或者减少当前数值。

components/swipe-action/index.en-US.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
category: Components
33
type: Gesture
44
title: SwipeAction
5+
version: 5.2.0-rc.1
56
---
67

78
iOS-style swipeout buttons that appear from behind a component.

components/swipe-action/index.zh-CN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ category: Components
33
type: Gesture
44
title: SwipeAction
55
subtitle: 滑动操作
6+
version: 5.2.0-rc.1
67
---
78

89
滑动操作组件。

0 commit comments

Comments
 (0)