mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-05 09:49:57 +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
36 lines
887 B
Markdown
36 lines
887 B
Markdown
---
|
|
order: 2
|
|
title:
|
|
zh-CN: 带有图标的通知提醒框
|
|
en-US: Notification with icon
|
|
---
|
|
|
|
## zh-CN
|
|
|
|
通知提醒框左侧有图标。
|
|
|
|
## en-US
|
|
|
|
A notification box with a icon at the left side.
|
|
|
|
```jsx
|
|
import { Button, notification, Space } from 'antd';
|
|
|
|
const openNotificationWithIcon = type => {
|
|
notification[type]({
|
|
message: 'Notification Title',
|
|
description:
|
|
'This is the content of the notification. This is the content of the notification. This is the content of the notification.',
|
|
});
|
|
};
|
|
|
|
export default () => (
|
|
<Space>
|
|
<Button onClick={() => openNotificationWithIcon('success')}>Success</Button>
|
|
<Button onClick={() => openNotificationWithIcon('info')}>Info</Button>
|
|
<Button onClick={() => openNotificationWithIcon('warning')}>Warning</Button>
|
|
<Button onClick={() => openNotificationWithIcon('error')}>Error</Button>
|
|
</Space>
|
|
);
|
|
```
|