mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 20:19:44 +08:00
fb4029c17f
Co-authored-by: star <a@qqfav.com>
28 lines
593 B
TypeScript
28 lines
593 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 type="link">Delete</Button>
|
|
</Popconfirm>
|
|
);
|
|
|
|
export default App;
|