偏右
9 years ago
9 changed files with 58 additions and 61 deletions
@ -0,0 +1,24 @@ |
|||
# 不自动消失 |
|||
|
|||
- order: 6 |
|||
|
|||
将 duration 配置为 null 即可。 |
|||
|
|||
--- |
|||
|
|||
````jsx |
|||
var notification = require('antd/lib/notification'); |
|||
|
|||
var openNotification = function() { |
|||
notification.open({ |
|||
message: "这是标题", |
|||
description: "这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案", |
|||
duration: null |
|||
}); |
|||
}; |
|||
|
|||
React.render( |
|||
<button className="ant-btn ant-btn-primary" onClick={openNotification}>显示通知,不自动消失</button> |
|||
, document.getElementById('components-notification-demo-duration')); |
|||
```` |
|||
|
@ -1,26 +0,0 @@ |
|||
# 距离顶部距离 |
|||
|
|||
- order: 1 |
|||
|
|||
自定义通知框距离顶部的距离,在`config`方法里设置`top`的值, **只在初始化时设置有效** ,默认距离顶部`24px`。 |
|||
|
|||
--- |
|||
|
|||
````jsx |
|||
var notification = require('antd/lib/notification'); |
|||
notification.config({ |
|||
top: 100 |
|||
}); |
|||
|
|||
var openNotification = function() { |
|||
var args = { |
|||
message: "这是标题", |
|||
description: "这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案", |
|||
}; |
|||
notification.open(args); |
|||
}; |
|||
|
|||
React.render( |
|||
<button className='ant-btn ant-btn-primary' onClick={openNotification}>打开通知提醒框</button> |
|||
, document.getElementById('components-notification-demo-top')); |
|||
```` |
Loading…
Reference in new issue