mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-16 01:41:02 +08:00
6776bb8916
* docs: update demo * chore: add script * test: fix demo test * docs: convert demos * chore: move script * test: remove react-dom import * chore: update deps * docs: update riddle js * test: fix image test * docs: fix riddle demo
47 lines
722 B
Markdown
47 lines
722 B
Markdown
---
|
|
order: 3
|
|
title:
|
|
zh-CN: 带徽标的头像
|
|
en-US: With Badge
|
|
---
|
|
|
|
## zh-CN
|
|
|
|
通常用于消息提示。
|
|
|
|
## en-US
|
|
|
|
Usually used for reminders and notifications.
|
|
|
|
```tsx
|
|
import { Avatar, Badge } from 'antd';
|
|
import { UserOutlined } from '@ant-design/icons';
|
|
|
|
export default () => (
|
|
<>
|
|
<span className="avatar-item">
|
|
<Badge count={1}>
|
|
<Avatar shape="square" icon={<UserOutlined />} />
|
|
</Badge>
|
|
</span>
|
|
<span>
|
|
<Badge dot>
|
|
<Avatar shape="square" icon={<UserOutlined />} />
|
|
</Badge>
|
|
</span>
|
|
</>
|
|
);
|
|
```
|
|
|
|
```css
|
|
/* tile uploaded pictures */
|
|
.avatar-item {
|
|
margin-right: 24px;
|
|
}
|
|
|
|
[class*='-col-rtl'] .avatar-item {
|
|
margin-right: 0;
|
|
margin-left: 24px;
|
|
}
|
|
```
|