mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-06 02:15:35 +08:00
497 B
497 B
order | title | ||||
---|---|---|---|---|---|
7 |
|
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);