Browse Source
docs(Avatar): add draggable api (#30073)
* docs(Avatar): add draggable api
* docs(Avatar): add draggable api
pull/30085/head
xiejiahe
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
2 additions and
0 deletions
-
components/avatar/index.en-US.md
-
components/avatar/index.zh-CN.md
|
|
@ -20,6 +20,7 @@ Avatars can be used to represent people or objects. It supports images, `Icon`s, |
|
|
|
| size | The size of the avatar | number \| `large` \| `small` \| `default` \| { xs: number, sm: number, ...} | `default` | 4.7.0 | |
|
|
|
| src | The address of the image for an image avatar or image element | string \| ReactNode | - | ReactNode: 4.8.0 | |
|
|
|
| srcSet | A list of sources to use for different screen resolutions | string | - | | |
|
|
|
| draggable | Whether the picture is allowed to be dragged | boolean \| `'true'` \| `'false'` | - | | |
|
|
|
| onError | Handler when img load error, return false to prevent default fallback behavior | () => boolean | - | | |
|
|
|
|
|
|
|
> Tip: You can set `icon` or `children` as the fallback for image load error, with the priority of `icon` > `children` |
|
|
|
|
|
@ -25,6 +25,7 @@ cover: https://gw.alipayobjects.com/zos/antfincdn/aBcnbw68hP/Avatar.svg |
|
|
|
| size | 设置头像的大小 | number \| `large` \| `small` \| `default` \| { xs: number, sm: number, ...} | `default` | 4.7.0 | |
|
|
|
| src | 图片类头像的资源地址或者图片元素 | string \| ReactNode | - | ReactNode: 4.8.0 | |
|
|
|
| srcSet | 设置图片类头像响应式资源地址 | string | - | | |
|
|
|
| draggable | 图片是否允许拖动 | boolean \| `'true'` \| `'false'` | - | | |
|
|
|
| onError | 图片加载失败的事件,返回 false 会关闭组件默认的 fallback 行为 | () => boolean | - | | |
|
|
|
|
|
|
|
> Tip:你可以设置 `icon` 或 `children` 作为图片加载失败的默认 fallback 行为,优先级为 `icon` > `children` |
|
|
|