2017-05-28 14:20:59 +08:00
|
|
|
---
|
|
|
|
order: 0
|
|
|
|
title:
|
|
|
|
zh-CN: 基本
|
|
|
|
en-US: Basic
|
|
|
|
---
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
|
|
|
头像有三种尺寸,两种形状可选。
|
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
|
|
|
Three sizes and two shapes are available.
|
|
|
|
|
2020-01-21 16:21:37 +08:00
|
|
|
```tsx
|
2017-06-19 12:13:33 +08:00
|
|
|
import { Avatar } from 'antd';
|
2019-11-28 12:34:33 +08:00
|
|
|
import { UserOutlined } from '@ant-design/icons';
|
2017-05-28 14:20:59 +08:00
|
|
|
|
|
|
|
ReactDOM.render(
|
2020-05-25 16:27:02 +08:00
|
|
|
<>
|
2017-06-19 12:13:33 +08:00
|
|
|
<div>
|
2019-11-28 12:34:33 +08:00
|
|
|
<Avatar size={64} icon={<UserOutlined />} />
|
|
|
|
<Avatar size="large" icon={<UserOutlined />} />
|
|
|
|
<Avatar icon={<UserOutlined />} />
|
|
|
|
<Avatar size="small" icon={<UserOutlined />} />
|
2017-06-19 12:13:33 +08:00
|
|
|
</div>
|
|
|
|
<div>
|
2019-11-28 12:34:33 +08:00
|
|
|
<Avatar shape="square" size={64} icon={<UserOutlined />} />
|
|
|
|
<Avatar shape="square" size="large" icon={<UserOutlined />} />
|
|
|
|
<Avatar shape="square" icon={<UserOutlined />} />
|
|
|
|
<Avatar shape="square" size="small" icon={<UserOutlined />} />
|
2017-06-19 12:13:33 +08:00
|
|
|
</div>
|
2020-05-25 16:27:02 +08:00
|
|
|
</>,
|
2019-05-07 14:57:32 +08:00
|
|
|
mountNode,
|
2018-11-28 15:00:03 +08:00
|
|
|
);
|
2019-05-07 14:57:32 +08:00
|
|
|
```
|
2017-06-19 12:13:33 +08:00
|
|
|
|
|
|
|
<style>
|
|
|
|
#components-avatar-demo-basic .ant-avatar {
|
|
|
|
margin-top: 16px;
|
|
|
|
margin-right: 16px;
|
|
|
|
}
|
2020-05-10 22:11:09 +08:00
|
|
|
.ant-row-rtl #components-avatar-demo-basic .ant-avatar {
|
|
|
|
margin-right: 0;
|
|
|
|
margin-left: 16px;
|
|
|
|
}
|
2017-06-19 12:13:33 +08:00
|
|
|
</style>
|