Skip to content

Commit

Permalink
doc(Badge): Update document.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Aug 17, 2021
1 parent 21e3d3d commit 2814be7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
27 changes: 20 additions & 7 deletions packages/core/src/Badge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,26 @@ function Demo() {
}
```

## props
## Props

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

| 参数 | 说明 | 类型 | 默认值 |
|------|------|-----|------|
| `text` | 文本内容 | String | - |
| `color` | 标记颜色 | String | - |
| `rounded` | 设置圆角 | Number | `5` |
| `textStyles` | 文本样式 | String | - |
```ts
import { ViewProps } from 'react-native';

export interface BadgeProps extends ViewProps {
children?: React.ReactNode;
/** 标记颜色 */
color?: colors.Colors | string;
/** 文本内容 */
text?: string | Element;
/**
* 设置圆角,默认 `12`
*/
rounded?: number;
/** 设置类型 */
type?: 'dot' | 'text';
/** 文本样式 */
textStyles?: StyleProp<TextStyle>;
}
```
4 changes: 4 additions & 0 deletions packages/core/src/Badge/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,17 @@ const styles = StyleSheet.create({

export interface BadgeProps extends ViewProps {
children?: React.ReactNode;
/** 标记颜色 */
color?: colors.Colors | string;
/** 文本内容 */
text?: string | Element;
/**
* 设置圆角,默认 `12`
*/
rounded?: number;
/** 设置类型 */
type?: 'dot' | 'text';
/** 文本样式 */
textStyles?: StyleProp<TextStyle>;
}

Expand Down

0 comments on commit 2814be7

Please sign in to comment.