mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-15 17:19:11 +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;
|