Skip to content

Commit 498ef9f

Browse files
committed
doc(TimeLine): Update props document. fix #148
1 parent a7504d7 commit 498ef9f

File tree

2 files changed

+24
-13
lines changed

2 files changed

+24
-13
lines changed

packages/core/src/Timeline/README.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,22 @@ function Demo() {
4040

4141
### props
4242

43-
| 参数 | 说明 | 类型 | 默认值 |
44-
| -------------------- | ------------ | ------- | ------- |
45-
| `items` |步骤条数据列表 | Item[] | - |
46-
| `isReverse` | 是否倒序 | Boolean | false |
47-
48-
49-
### Item[]
43+
```ts
44+
export interface TimelineItemsProps {
45+
/** 标题 */
46+
title: string;
47+
/** 子标题 */
48+
tips?: string;
49+
/** 标示颜色 */
50+
color?: string;
51+
/** 子项内容 */
52+
desc?: string | string[];
53+
}
5054

51-
| 参数 | 说明 | 类型 | 默认值 |
52-
| -------------------- | ------------ | ------- | ------- |
53-
| `title` |标题 | Item[] | - |
54-
| `tips` |子标题 | String | - |
55-
| `desc` | 子项内容 | String / string[] | - |
56-
| `color` | 标示颜色 | String | - |
55+
export interface TimelineProps extends ViewProps {
56+
/** 是否倒序 */
57+
isReverse?: boolean;
58+
/** 步骤条数据列表 */
59+
items: TimelineItemsProps[];
60+
}
61+
```

packages/core/src/Timeline/index.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,20 @@ import React, { useState, useEffect } from 'react';
33
import {View, Text, StyleSheet, ViewProps} from 'react-native';
44

55
export interface TimelineItemsProps {
6+
/** 标题 */
67
title: string;
8+
/** 子标题 */
79
tips?: string;
10+
/** 标示颜色 */
811
color?: string;
12+
/** 子项内容 */
913
desc?: string | string[];
1014
}
1115

1216
export interface TimelineProps extends ViewProps {
17+
/** 是否倒序 */
1318
isReverse?: boolean;
19+
/** 步骤条数据列表 */
1420
items: TimelineItemsProps[];
1521
}
1622

0 commit comments

Comments
 (0)