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.
|
|
|
|
|
2019-05-07 14:57:32 +08:00
|
|
|
```jsx
|
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(
|
|
|
|
<div>
|
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>
|
2018-06-27 15:55:04 +08:00
|
|
|
</div>,
|
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;
|
|
|
|
}
|
|
|
|
</style>
|