ant-design/components/popconfirm/demo/basic.md

41 lines
543 B
Markdown
Raw Normal View History

2016-03-31 09:40:55 +08:00
---
order: 0
title:
zh-CN: 基本
en-US: Basic
2016-03-31 09:40:55 +08:00
---
2015-06-24 19:20:47 +08:00
## zh-CN
2015-06-24 19:20:47 +08:00
最简单的用法。
## en-US
The basic example.
2019-05-07 14:57:32 +08:00
```jsx
import { Popconfirm, message } from 'antd';
2015-06-24 19:20:47 +08:00
function confirm(e) {
console.log(e);
message.success('Click on Yes');
2015-07-17 00:25:03 +08:00
}
function cancel(e) {
console.log(e);
message.error('Click on No');
2015-06-24 19:20:47 +08:00
}
export default () => (
2019-05-07 14:57:32 +08:00
<Popconfirm
2020-11-16 09:27:02 +08:00
title="Are you sure to delete this task?"
2019-05-07 14:57:32 +08:00
onConfirm={confirm}
onCancel={cancel}
okText="Yes"
cancelText="No"
>
<a href="#">Delete</a>
</Popconfirm>
2018-11-28 15:00:03 +08:00
);
2019-05-07 14:57:32 +08:00
```