2016-03-31 09:40:55 +08:00
|
|
|
---
|
|
|
|
order: 0
|
2016-08-26 14:42:41 +08:00
|
|
|
title:
|
|
|
|
zh-CN: 基本
|
|
|
|
en-US: Basic
|
2016-03-31 09:40:55 +08:00
|
|
|
---
|
2015-06-24 19:20:47 +08:00
|
|
|
|
2016-08-26 14:42:41 +08:00
|
|
|
## zh-CN
|
|
|
|
|
2015-06-24 19:20:47 +08:00
|
|
|
最简单的用法。
|
|
|
|
|
2016-08-26 14:42:41 +08:00
|
|
|
## en-US
|
|
|
|
|
|
|
|
The basic example.
|
|
|
|
|
2017-02-13 10:55:53 +08:00
|
|
|
````jsx
|
2015-10-28 20:55:49 +08:00
|
|
|
import { Popconfirm, message } from 'antd';
|
2015-06-24 19:20:47 +08:00
|
|
|
|
2017-02-24 16:07:39 +08:00
|
|
|
function confirm(e) {
|
|
|
|
console.log(e);
|
2016-09-29 11:27:59 +08:00
|
|
|
message.success('Click on Yes');
|
2015-07-17 00:25:03 +08:00
|
|
|
}
|
|
|
|
|
2017-02-24 16:07:39 +08:00
|
|
|
function cancel(e) {
|
|
|
|
console.log(e);
|
2016-09-29 11:27:59 +08:00
|
|
|
message.error('Click on No');
|
2015-06-24 19:20:47 +08:00
|
|
|
}
|
|
|
|
|
2015-10-20 16:47:55 +08:00
|
|
|
ReactDOM.render(
|
2016-09-29 11:27:59 +08:00
|
|
|
<Popconfirm title="Are you sure delete this task?" onConfirm={confirm} onCancel={cancel} okText="Yes" cancelText="No">
|
|
|
|
<a href="#">Delete</a>
|
2018-06-27 15:55:04 +08:00
|
|
|
</Popconfirm>,
|
2018-11-28 15:00:03 +08:00
|
|
|
mountNode
|
|
|
|
);
|
2015-06-24 19:20:47 +08:00
|
|
|
````
|