diff --git a/packages/core/src/Avatar/README.md b/packages/core/src/Avatar/README.md index 4e19627fe..e894f99a5 100644 --- a/packages/core/src/Avatar/README.md +++ b/packages/core/src/Avatar/README.md @@ -26,10 +26,28 @@ function Demo() { 继承 [View](https://facebook.github.io/react-native/docs/view#props) 组件。 -| 参数 | 说明 | 类型 | 默认值 | -|------|------|-----|------| -| `src` | 图像源(远程URL或本地文件资源)。 | String/Number | - | -| `imageProps` | React Native `Image` 组件 Props | ImageProps | - | -| `size` | 设置圆角 | Number | `40` | -| `rounded` | 设置圆角 | Number | `3` | -| `shape` | 指定头像的形状 `square` 正方形或者 `circle` 圆 | `circle`/`square` | `square` | \ No newline at end of file +```ts +import { ViewProps } from 'react-native'; + +export interface AvatarProps extends ViewProps { + /** React Native `Image` 组件 Props */ + imageProps?: ImageProps; + /** 图像源(远程URL或本地文件资源)。 */ + src?: string | number; + /** + * 尺寸 + * @default 40 + */ + size?: number; + /** + * 设置圆角 + * @default 3 + */ + rounded?: number; + /** + * 指定头像的形状 + * @default square + */ + shape?: 'circle' | 'square'; +} +``` \ No newline at end of file diff --git a/packages/core/src/Avatar/index.tsx b/packages/core/src/Avatar/index.tsx index 2ba0980c7..9952e79ac 100644 --- a/packages/core/src/Avatar/index.tsx +++ b/packages/core/src/Avatar/index.tsx @@ -15,10 +15,24 @@ const styles = StyleSheet.create({ const defaultImage = require('./assets/user.png'); export interface AvatarProps extends ViewProps { + /** React Native `Image` 组件 Props */ imageProps?: ImageProps; + /** 图像源(远程URL或本地文件资源)。 */ src?: string | number; + /** + * 尺寸 + * @default 40 + */ size?: number; + /** + * 设置圆角 + * @default 3 + */ rounded?: number; + /** + * 指定头像的形状 + * @default square + */ shape?: 'circle' | 'square'; }