ant-design/components/modal/demo/manual.md
2017-01-19 15:22:53 +08:00

512 B

order debug title
7 true
zh-CN en-US
手动移除 Manual to destroy

zh-CN

手动关闭modal。

en-US

Manually destroying a modal.

import { Modal, Button } from 'antd';

function success() {
  const modal = Modal.success({
    title: 'This is a notification message',
    content: 'This modal will be destroyed after 1 second',
  });
  setTimeout(() => modal.destroy(), 1000);
}


ReactDOM.render(<div>
  <Button onClick={success}>Success</Button>
</div>, mountNode);