mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 19:19:26 +08:00
commit
eb42ada2cd
@ -3,12 +3,15 @@ import Notification from 'rc-notification';
|
||||
|
||||
let defaultDuration = 1.5;
|
||||
|
||||
var messageInstance;
|
||||
|
||||
function getMessageInstance() {
|
||||
return Notification.newInstance({
|
||||
messageInstance = messageInstance || Notification.newInstance({
|
||||
prefixCls: 'ant-message',
|
||||
transitionName: 'move-up',
|
||||
style: {} // 覆盖原来的样式
|
||||
});
|
||||
return messageInstance;
|
||||
}
|
||||
|
||||
function notice(content, duration = defaultDuration, type) {
|
||||
@ -18,7 +21,6 @@ function notice(content, duration = defaultDuration, type) {
|
||||
'error': 'anticon-exclamation-circle ant-message-error'
|
||||
})[type];
|
||||
getMessageInstance().notice({
|
||||
key: 'simpleMessage',
|
||||
duration: duration,
|
||||
style: {},
|
||||
content: <div className="ant-message-custom-content">
|
||||
|
Loading…
Reference in New Issue
Block a user