ant-design/components/notification/demo/basic.md

22 lines
542 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
order: 0
title: 基本
---
最简单的用法4.5 秒后自动关闭。
````jsx
import { Button, notification } from 'antd';
const openNotification = function () {
notification.open({
message: '这是标题',
description: '这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案',
});
};
ReactDOM.render(
<Button type="primary" onClick={openNotification}>打开通知提醒框</Button>
, mountNode);
````