mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-05 05:28:20 +08:00
596 B
596 B
order | title | ||||
---|---|---|---|---|---|
3 |
|
zh-CN
使用 confirm()
可以快捷地弹出确认框。
en-US
To use confirm()
to popup a confirmation modal dialog.
import { Modal, Button } from 'antd';
const confirm = Modal.confirm;
function showConfirm() {
confirm({
title: 'Want to delete these items?',
content: 'some descriptions',
onOk() {
console.log('OK');
},
onCancel() {},
});
}
ReactDOM.render(
<Button onClick={showConfirm}>
confirmation modal dialog
</Button>
, mountNode);