mirror of
https://github.com/ant-design/ant-design.git
synced 2025-07-23 14:46:57 +08:00
modal destroy (#2124)
* modal destroy * document and typo * remove blank line
This commit is contained in:
parent
3c408e0d22
commit
0b3146dba0
@ -129,4 +129,8 @@ export default function confirm(config) {
|
||||
, div, function () {
|
||||
d = this;
|
||||
});
|
||||
|
||||
return {
|
||||
destroy: close,
|
||||
};
|
||||
}
|
||||
|
23
components/modal/demo/manual.md
Normal file
23
components/modal/demo/manual.md
Normal 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);
|
||||
````
|
Loading…
Reference in New Issue
Block a user