2016-03-31 09:40:55 +08:00
|
|
|
---
|
|
|
|
order: 1
|
2016-08-26 14:42:41 +08:00
|
|
|
title:
|
|
|
|
zh-CN: 位置
|
|
|
|
en-US: Placement
|
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
|
|
|
|
|
2016-08-31 13:50:50 +08:00
|
|
|
位置有十二个方向。如需箭头指向目标元素中心,可以设置 `arrowPointAtCenter`。
|
2015-06-24 19:20:47 +08:00
|
|
|
|
2016-08-26 14:42:41 +08:00
|
|
|
## en-US
|
|
|
|
|
2016-08-31 15:00:13 +08:00
|
|
|
There are 12 `placement` options available. Use `arrowPointAtCenter` if you want arrow point at the center of target.
|
2016-08-26 14:42:41 +08:00
|
|
|
|
2015-06-24 19:20:47 +08:00
|
|
|
````jsx
|
2015-11-04 17:50:49 +08:00
|
|
|
import { Popconfirm, message, Button } from 'antd';
|
2015-10-28 20:55:49 +08:00
|
|
|
|
2016-09-29 11:27:59 +08:00
|
|
|
const text = 'Are you sure delete this task?';
|
2015-06-24 19:20:47 +08:00
|
|
|
|
|
|
|
function confirm() {
|
2016-09-29 11:27:59 +08:00
|
|
|
message.info('Click on Yes.');
|
2015-06-24 19:20:47 +08:00
|
|
|
}
|
|
|
|
|
2015-10-20 16:47:55 +08:00
|
|
|
ReactDOM.render(<div>
|
2016-01-27 16:44:50 +08:00
|
|
|
<div style={{ marginLeft: 60 }}>
|
2016-09-29 11:27:59 +08:00
|
|
|
<Popconfirm placement="topLeft" title={text} onConfirm={confirm} okText="Yes" cancelText="No">
|
|
|
|
<Button>TL</Button>
|
2015-11-05 18:14:20 +08:00
|
|
|
</Popconfirm>
|
2016-09-29 11:27:59 +08:00
|
|
|
<Popconfirm placement="top" title={text} onConfirm={confirm} okText="Yes" cancelText="No">
|
|
|
|
<Button>Top</Button>
|
2015-11-05 18:14:20 +08:00
|
|
|
</Popconfirm>
|
2016-09-29 11:27:59 +08:00
|
|
|
<Popconfirm placement="topRight" title={text} onConfirm={confirm} okText="Yes" cancelText="No">
|
|
|
|
<Button>TR</Button>
|
2015-11-05 18:14:20 +08:00
|
|
|
</Popconfirm>
|
|
|
|
</div>
|
2016-01-27 16:44:50 +08:00
|
|
|
<div style={{ width: 60, float: 'left' }}>
|
2016-09-29 11:27:59 +08:00
|
|
|
<Popconfirm placement="leftTop" title={text} onConfirm={confirm} okText="Yes" cancelText="No">
|
|
|
|
<Button>LT</Button>
|
2015-11-05 18:14:20 +08:00
|
|
|
</Popconfirm>
|
2016-09-29 11:27:59 +08:00
|
|
|
<Popconfirm placement="left" title={text} onConfirm={confirm} okText="Yes" cancelText="No">
|
|
|
|
<Button>Left</Button>
|
2015-11-05 18:14:20 +08:00
|
|
|
</Popconfirm>
|
2016-09-29 11:27:59 +08:00
|
|
|
<Popconfirm placement="leftBottom" title={text} onConfirm={confirm} okText="Yes" cancelText="No">
|
|
|
|
<Button>LB</Button>
|
2015-11-05 18:14:20 +08:00
|
|
|
</Popconfirm>
|
|
|
|
</div>
|
2016-01-27 16:44:50 +08:00
|
|
|
<div style={{ width: 60, marginLeft: 252 }}>
|
2016-09-29 11:27:59 +08:00
|
|
|
<Popconfirm placement="rightTop" title={text} onConfirm={confirm} okText="Yes" cancelText="No">
|
|
|
|
<Button>RT</Button>
|
2015-11-05 18:14:20 +08:00
|
|
|
</Popconfirm>
|
2016-09-29 11:27:59 +08:00
|
|
|
<Popconfirm placement="right" title={text} onConfirm={confirm} okText="Yes" cancelText="No">
|
|
|
|
<Button>Right</Button>
|
2015-11-05 18:14:20 +08:00
|
|
|
</Popconfirm>
|
2016-09-29 11:27:59 +08:00
|
|
|
<Popconfirm placement="rightBottom" title={text} onConfirm={confirm} okText="Yes" cancelText="No">
|
|
|
|
<Button>RB</Button>
|
2015-11-05 18:14:20 +08:00
|
|
|
</Popconfirm>
|
|
|
|
</div>
|
2016-01-27 16:44:50 +08:00
|
|
|
<div style={{ marginLeft: 60, clear: 'both' }}>
|
2016-09-29 11:27:59 +08:00
|
|
|
<Popconfirm placement="bottomLeft" title={text} onConfirm={confirm} okText="Yes" cancelText="No">
|
|
|
|
<Button>BL</Button>
|
2015-11-05 18:14:20 +08:00
|
|
|
</Popconfirm>
|
2016-09-29 11:27:59 +08:00
|
|
|
<Popconfirm placement="bottom" title={text} onConfirm={confirm} okText="Yes" cancelText="No">
|
|
|
|
<Button>Bottom</Button>
|
2015-11-05 18:14:20 +08:00
|
|
|
</Popconfirm>
|
2016-09-29 11:27:59 +08:00
|
|
|
<Popconfirm placement="bottomRight" title={text} onConfirm={confirm} okText="Yes" cancelText="No">
|
|
|
|
<Button>BR</Button>
|
2015-11-05 18:14:20 +08:00
|
|
|
</Popconfirm>
|
|
|
|
</div>
|
2015-12-29 12:08:58 +08:00
|
|
|
</div>, mountNode);
|
2015-06-24 19:20:47 +08:00
|
|
|
````
|
|
|
|
|
|
|
|
<style>
|
2015-06-26 10:22:08 +08:00
|
|
|
.code-box-demo .ant-popover-wrap > a {
|
2015-06-24 19:20:47 +08:00
|
|
|
margin-right: 1em;
|
|
|
|
}
|
2015-11-04 17:50:49 +08:00
|
|
|
.code-box-demo .ant-btn {
|
|
|
|
margin-right: 1em;
|
|
|
|
margin-bottom: 1em;
|
|
|
|
}
|
2015-06-24 19:20:47 +08:00
|
|
|
</style>
|