mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-19 20:08:43 +08:00
f928baf52a
* add flex style * add new demo * update snapshot * Merge branch feature into fix-descriptions * update snapshot * update snapshot
32 lines
452 B
Markdown
32 lines
452 B
Markdown
---
|
|
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,
|
|
);
|
|
```
|