AntD Modal.confirm confirmation pop-up box usage

<a className={"deleteProject"} onClick={() => this.showDeleteConfirm(record.id)}>删除</a>
OClick event of a button // This function is called 
showDeleteConfirm = (the above mentioned id) => {
Modal.confirm ({
title: '? Confirm delete this item you',
icon: <ExclamationCircleOutlined />,
Content: '',
okText: 'is' ,
okType: 'Danger',
CancelText: 'No',
OnOK: () => {
this.handleOk (ID) // callback method to confirm button below
}
,
the onCancel () {
the console.log ( 'the Cancel') ;
}
});
};

// delete the popup confirmation button, delete operation 
handleOk = (ID) => {
the let the params = {ID: ID};
fetchPost (global.constants.deleteProject here to fill their backend interface [url], the params) .then (
RES => this.setData (RES)
) .catch (E => the console.log (E))
.finally (() => {
this.setState ({
requestLoading: to false
})
});
};

Guess you like

Origin www.cnblogs.com/gslgb/p/12628867.html