ant-design/components/modal/demo/confirm.md
ddcat1115 24e6fb4ba6 fix Modal.confirm error when onCancel not set (#5294)
* fix Modal.confirm error when onCancel not set

* add test case
2017-03-17 11:47:36 +08:00

626 B

order title
3
zh-CN en-US
确认对话框 Confirmation modal dialog

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() {
      console.log('Cancel');
    },
  });
}

ReactDOM.render(
  <Button onClick={showConfirm}>
    confirmation modal dialog
  </Button>
, mountNode);