Skip to content

Commit 3065ff7

Browse files
committed
doc(Avatar): Update document.
1 parent 2814be7 commit 3065ff7

File tree

2 files changed

+39
-7
lines changed

2 files changed

+39
-7
lines changed

packages/core/src/Avatar/README.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,28 @@ function Demo() {
2626

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

29-
| 参数 | 说明 | 类型 | 默认值 |
30-
|------|------|-----|------|
31-
| `src` | 图像源(远程URL或本地文件资源)。 | String/Number | - |
32-
| `imageProps` | React Native `Image` 组件 Props | ImageProps | - |
33-
| `size` | 设置圆角 | Number | `40` |
34-
| `rounded` | 设置圆角 | Number | `3` |
35-
| `shape` | 指定头像的形状 `square` 正方形或者 `circle`| `circle`/`square` | `square` |
29+
```ts
30+
import { ViewProps } from 'react-native';
31+
32+
export interface AvatarProps extends ViewProps {
33+
/** React Native `Image` 组件 Props */
34+
imageProps?: ImageProps;
35+
/** 图像源(远程URL或本地文件资源)。 */
36+
src?: string | number;
37+
/**
38+
* 尺寸
39+
* @default 40
40+
*/
41+
size?: number;
42+
/**
43+
* 设置圆角
44+
* @default 3
45+
*/
46+
rounded?: number;
47+
/**
48+
* 指定头像的形状
49+
* @default square
50+
*/
51+
shape?: 'circle' | 'square';
52+
}
53+
```

packages/core/src/Avatar/index.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,24 @@ const styles = StyleSheet.create({
1515
const defaultImage = require('./assets/user.png');
1616

1717
export interface AvatarProps extends ViewProps {
18+
/** React Native `Image` 组件 Props */
1819
imageProps?: ImageProps;
20+
/** 图像源(远程URL或本地文件资源)。 */
1921
src?: string | number;
22+
/**
23+
* 尺寸
24+
* @default 40
25+
*/
2026
size?: number;
27+
/**
28+
* 设置圆角
29+
* @default 3
30+
*/
2131
rounded?: number;
32+
/**
33+
* 指定头像的形状
34+
* @default square
35+
*/
2236
shape?: 'circle' | 'square';
2337
}
2438

0 commit comments

Comments
 (0)