ant-design/components/popconfirm/demo/basic.tsx
二货爱吃白萝卜 2cdf586291
chore: fix lint (#43873)
* chore: fix lint

* chore: fix lint

* test: fix 16

* fix: lint
2023-07-28 16:17:43 +08:00

28 lines
588 B
TypeScript

import React from 'react';
import { Button, message, Popconfirm } from 'antd';
const confirm = (e: React.MouseEvent<HTMLElement>) => {
console.log(e);
message.success('Click on Yes');
};
const cancel = (e: React.MouseEvent<HTMLElement>) => {
console.log(e);
message.error('Click on No');
};
const App: React.FC = () => (
<Popconfirm
title="Delete the task"
description="Are you sure to delete this task?"
onConfirm={confirm}
onCancel={cancel}
okText="Yes"
cancelText="No"
>
<Button danger>Delete</Button>
</Popconfirm>
);
export default App;