前端: 添加确认对话框组件

This commit is contained in:
Frontend Developer 2026-03-10 09:14:51 +00:00
parent 16c37770c4
commit 918908664d

View File

@ -0,0 +1,29 @@
import React from 'react';
import { Modal } from 'antd';
function ConfirmDialog({
open,
title = '确认',
content = '确定要执行此操作吗?',
onConfirm,
onCancel,
confirmText = '确定',
cancelText = '取消',
danger = false
}) {
return (
<Modal
title={title}
open={open}
onOk={onConfirm}
onCancel={onCancel}
okText={confirmText}
cancelText={cancelText}
okButtonProps={{ danger }}
>
<p>{content}</p>
</Modal>
);
}
export default ConfirmDialog;