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

25 lines
726 B
Markdown
Raw Normal View History

2015-08-04 17:41:12 +08:00
# 自动关闭的延时
2015-08-03 15:17:12 +08:00
- order: 1
2015-08-04 17:41:12 +08:00
自定义通知框自动关闭的延时,默认`3s`,取消自动关闭只要将该值设为`0`即可。
2015-08-03 15:17:12 +08:00
---
````jsx
var notification = require('antd/lib/notification');
var openNotification = function() {
var args = {
message: "这是标题",
description: "这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案",
2015-08-04 17:41:12 +08:00
duration: 10
2015-08-03 15:17:12 +08:00
};
notification.open(args);
};
React.render(
2015-08-04 16:07:31 +08:00
<button className='ant-btn ant-btn-primary' onClick={openNotification}>打开通知提醒框</button>
2015-08-04 17:41:12 +08:00
, document.getElementById('components-notification-demo-duration'));
2015-08-04 15:16:10 +08:00
````