Skip to content

Commit 2814be7

Browse files
committed
doc(Badge): Update document.
1 parent 21e3d3d commit 2814be7

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

packages/core/src/Badge/README.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,26 @@ function Demo() {
1717
}
1818
```
1919

20-
## props
20+
## Props
2121

2222
继承 [View](https://facebook.github.io/react-native/docs/view#props) 组件。
2323

24-
| 参数 | 说明 | 类型 | 默认值 |
25-
|------|------|-----|------|
26-
| `text` | 文本内容 | String | - |
27-
| `color` | 标记颜色 | String | - |
28-
| `rounded` | 设置圆角 | Number | `5` |
29-
| `textStyles` | 文本样式 | String | - |
24+
```ts
25+
import { ViewProps } from 'react-native';
26+
27+
export interface BadgeProps extends ViewProps {
28+
children?: React.ReactNode;
29+
/** 标记颜色 */
30+
color?: colors.Colors | string;
31+
/** 文本内容 */
32+
text?: string | Element;
33+
/**
34+
* 设置圆角,默认 `12`
35+
*/
36+
rounded?: number;
37+
/** 设置类型 */
38+
type?: 'dot' | 'text';
39+
/** 文本样式 */
40+
textStyles?: StyleProp<TextStyle>;
41+
}
42+
```

packages/core/src/Badge/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,17 @@ const styles = StyleSheet.create({
2626

2727
export interface BadgeProps extends ViewProps {
2828
children?: React.ReactNode;
29+
/** 标记颜色 */
2930
color?: colors.Colors | string;
31+
/** 文本内容 */
3032
text?: string | Element;
3133
/**
3234
* 设置圆角,默认 `12`
3335
*/
3436
rounded?: number;
37+
/** 设置类型 */
3538
type?: 'dot' | 'text';
39+
/** 文本样式 */
3640
textStyles?: StyleProp<TextStyle>;
3741
}
3842

0 commit comments

Comments
 (0)