diff --git a/components/message/index.jsx b/components/message/index.jsx index 165871f817..9f9ddb20de 100644 --- a/components/message/index.jsx +++ b/components/message/index.jsx @@ -4,14 +4,17 @@ import Notification from 'rc-notification'; let defaultDuration = 1.5; let top; +var messageInstance; + function getMessageInstance() { - return Notification.newInstance({ + messageInstance = messageInstance || Notification.newInstance({ prefixCls: 'ant-message', transitionName: 'move-up', style: { top: top } // 覆盖原来的样式 }); + return messageInstance; } function notice(content, duration = defaultDuration, type) { @@ -21,7 +24,6 @@ function notice(content, duration = defaultDuration, type) { 'error': 'anticon-exclamation-circle ant-message-error' })[type]; getMessageInstance().notice({ - key: 'simpleMessage', duration: duration, style: {}, content: