2015-06-24 19:20:47 +08:00
|
|
|
# 位置
|
|
|
|
|
|
|
|
- order: 1
|
|
|
|
|
|
|
|
位置有四个方向。
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
````jsx
|
2015-11-04 17:50:49 +08:00
|
|
|
import { Popconfirm, message, Button } from 'antd';
|
2015-10-28 20:55:49 +08:00
|
|
|
|
|
|
|
const text = '确定要删除这个任务吗?';
|
2015-06-24 19:20:47 +08:00
|
|
|
|
|
|
|
function confirm() {
|
2015-07-17 00:25:03 +08:00
|
|
|
message.info('点击了确定');
|
2015-06-24 19:20:47 +08:00
|
|
|
}
|
|
|
|
|
2015-10-20 16:47:55 +08:00
|
|
|
ReactDOM.render(<div>
|
2015-11-04 17:50:49 +08:00
|
|
|
<Popconfirm placement="leftTop" title={text} onConfirm={confirm}>
|
|
|
|
<Button>左上</Button>
|
|
|
|
</Popconfirm>
|
2015-06-24 19:20:47 +08:00
|
|
|
<Popconfirm placement="left" title={text} onConfirm={confirm}>
|
2015-11-04 17:50:49 +08:00
|
|
|
<Button>左</Button>
|
|
|
|
</Popconfirm>
|
|
|
|
<Popconfirm placement="leftBottom" title={text} onConfirm={confirm}>
|
|
|
|
<Button>左下</Button>
|
|
|
|
</Popconfirm>
|
|
|
|
<br/>
|
|
|
|
<Popconfirm placement="topLeft" title={text} onConfirm={confirm}>
|
|
|
|
<Button>上左</Button>
|
2015-06-24 19:20:47 +08:00
|
|
|
</Popconfirm>
|
|
|
|
<Popconfirm placement="top" title={text} onConfirm={confirm}>
|
2015-11-04 17:50:49 +08:00
|
|
|
<Button>上</Button>
|
|
|
|
</Popconfirm>
|
|
|
|
<Popconfirm placement="topRight" title={text} onConfirm={confirm}>
|
|
|
|
<Button>上右</Button>
|
|
|
|
</Popconfirm>
|
|
|
|
<br/>
|
|
|
|
<Popconfirm placement="bottomLeft" title={text} onConfirm={confirm}>
|
|
|
|
<Button>下左</Button>
|
2015-06-24 19:20:47 +08:00
|
|
|
</Popconfirm>
|
|
|
|
<Popconfirm placement="bottom" title={text} onConfirm={confirm}>
|
2015-11-04 17:50:49 +08:00
|
|
|
<Button>下</Button>
|
|
|
|
</Popconfirm>
|
|
|
|
<Popconfirm placement="bottomRight" title={text} onConfirm={confirm}>
|
|
|
|
<Button>下右</Button>
|
|
|
|
</Popconfirm>
|
|
|
|
<br/>
|
|
|
|
<Popconfirm placement="rightTop" title={text} onConfirm={confirm}>
|
|
|
|
<Button>右上</Button>
|
2015-06-24 19:20:47 +08:00
|
|
|
</Popconfirm>
|
2015-08-17 17:55:39 +08:00
|
|
|
<Popconfirm placement="right" title={text} onConfirm={confirm}>
|
2015-11-04 17:50:49 +08:00
|
|
|
<Button>右</Button>
|
|
|
|
</Popconfirm>
|
|
|
|
<Popconfirm placement="rightBottom" title={text} onConfirm={confirm}>
|
|
|
|
<Button>右下</Button>
|
2015-08-17 17:55:39 +08:00
|
|
|
</Popconfirm>
|
2015-06-24 19:20:47 +08:00
|
|
|
</div>, document.getElementById('components-popconfirm-demo-placement'));
|
|
|
|
````
|
|
|
|
|
|
|
|
<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>
|