Browse Source
* refactor: avatar code * fix: Fix Avatar fallback bug close #25801 * add blank * update demopull/25816/head
偏右
4 years ago
committed by
GitHub
5 changed files with 129 additions and 50 deletions
@ -0,0 +1,37 @@ |
|||
--- |
|||
order: 99 |
|||
title: |
|||
zh-CN: 图片不存在时 |
|||
en-US: Fallback |
|||
debug: true |
|||
--- |
|||
|
|||
## zh-CN |
|||
|
|||
图片不存在时,会回退到 `src`。 |
|||
|
|||
## en-US |
|||
|
|||
图片不存在时,会回退到 `src`。 |
|||
|
|||
```tsx |
|||
import { Avatar } from 'antd'; |
|||
|
|||
ReactDOM.render( |
|||
<> |
|||
<Avatar |
|||
shape="circle" |
|||
src="http://abc.com/not-exist.jpg" |
|||
> |
|||
A |
|||
</Avatar> |
|||
<Avatar |
|||
shape="circle" |
|||
src="http://abc.com/not-exist.jpg" |
|||
> |
|||
ABC |
|||
</Avatar> |
|||
</>, |
|||
mountNode, |
|||
); |
|||
``` |
Loading…
Reference in new issue