mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-05 05:28:20 +08:00
74d5718ee7
* demo: update popconfirm demo * demo: update snapshot
28 lines
588 B
TypeScript
28 lines
588 B
TypeScript
import { Button, message, Popconfirm } from 'antd';
|
|
import React from 'react';
|
|
|
|
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;
|