UNPKG

cjd-parkball

Version:

> 中后台业务组件库,中后台就像公园,进入需要买门票(登录),所以以 Parkball(公园球) 命名,公园内必定捕获!作为一个组件库,提供使用方法文档,方便开发者的调用

60 lines (50 loc) 1.01 kB
--- category: 2 title: 确认对话框 title_en: Confirmation modal dialog --- zh-CN 使用 `confirm()` 可以快捷地弹出确认框。 en-US To use `confirm()` to popup a confirmation modal dialog. ````jsx import { Modal, Button } from 'parkball'; const confirm = Modal.confirm; function showConfirm() { confirm({ title: 'Do you Want to delete these items?', content: 'Some descriptions', onOk() { console.log('OK'); }, onCancel() { console.log('Cancel'); }, }); } function showDeleteConfirm() { confirm({ title: 'Are you sure delete this task?', content: 'Some descriptions', okText: 'Yes', okType: 'danger', cancelText: 'No', onOk() { console.log('OK'); }, onCancel() { console.log('Cancel'); }, }); } ReactDOM.render( <div> <Button onClick={showConfirm}> Confirm </Button> <Button onClick={showDeleteConfirm} type="dashed"> Delete </Button> </div>, mountNode); ````