mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-12 15:19:58 +08:00
27 lines
538 B
TypeScript
27 lines
538 B
TypeScript
|
import React from 'react';
|
||
|
import { 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="Are you sure to delete this task?"
|
||
|
onConfirm={confirm}
|
||
|
onCancel={cancel}
|
||
|
okText="Yes"
|
||
|
cancelText="No"
|
||
|
>
|
||
|
<a href="#">Delete</a>
|
||
|
</Popconfirm>
|
||
|
);
|
||
|
|
||
|
export default App;
|