modal destroy (#2124)

* modal destroy

* document and typo

* remove blank line
This commit is contained in:
陆离 2016-06-21 18:50:07 +08:00 committed by 偏右
parent 3c408e0d22
commit 0b3146dba0
2 changed files with 27 additions and 0 deletions

View File

@ -129,4 +129,8 @@ export default function confirm(config) {
, div, function () { , div, function () {
d = this; d = this;
}); });
return {
destroy: close,
};
} }

View File

@ -0,0 +1,23 @@
---
order: 7
title: 手动移除
---
手动关闭modal。
````jsx
import { Modal, Button } from 'antd';
function success() {
const modal = Modal.success({
title: '这是一条通知信息',
content: '一秒后自动移除',
});
setTimeout(() => modal.destroy(), 1000);
}
ReactDOM.render(<div>
<Button onClick={success}>成功提示</Button>
</div>, mountNode);
````