ant-design/components/notification/demo/top.md
2015-08-04 16:07:31 +08:00

780 B

距离顶部距离

  • order: 1

自定义通知框距离顶部的距离,在config方法里设置top的值, 只在初始化时设置有效 ,默认距离顶部24px


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'));