2015-06-17 16:58:13 +08:00
|
|
|
# 位置
|
|
|
|
|
|
|
|
- order: 1
|
|
|
|
|
2015-09-28 21:02:04 +08:00
|
|
|
位置有十二个方向。
|
2015-06-17 16:58:13 +08:00
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
````jsx
|
2015-10-28 20:55:49 +08:00
|
|
|
import { Popover, Button } from 'antd';
|
2015-10-08 15:13:04 +08:00
|
|
|
|
2015-10-28 20:55:49 +08:00
|
|
|
const text = <span>标题</span>;
|
|
|
|
const content = <div>
|
2015-06-17 16:58:13 +08:00
|
|
|
<p>内容</p>
|
2015-07-08 20:53:11 +08:00
|
|
|
<p>内容</p>
|
|
|
|
</div>;
|
2015-06-17 16:58:13 +08:00
|
|
|
|
2015-10-20 16:47:55 +08:00
|
|
|
ReactDOM.render(<div>
|
2015-09-28 21:02:04 +08:00
|
|
|
<Popover placement="leftTop" title={text} overlay={content} trigger="click">
|
2015-11-04 17:50:49 +08:00
|
|
|
<Button>左上</Button>
|
2015-09-28 21:02:04 +08:00
|
|
|
</Popover>
|
|
|
|
<Popover placement="left" title={text} overlay={content} trigger="click">
|
2015-10-08 15:13:04 +08:00
|
|
|
<Button>左</Button>
|
2015-06-17 16:58:13 +08:00
|
|
|
</Popover>
|
2015-09-28 21:02:04 +08:00
|
|
|
<Popover placement="leftBottom" title={text} overlay={content} trigger="click">
|
2015-11-04 17:50:49 +08:00
|
|
|
<Button>左下</Button>
|
2015-09-28 21:02:04 +08:00
|
|
|
</Popover>
|
|
|
|
<br/>
|
|
|
|
<Popover placement="topLeft" title={text} overlay={content} trigger="click">
|
2015-11-04 17:50:49 +08:00
|
|
|
<Button>上左</Button>
|
2015-09-28 21:02:04 +08:00
|
|
|
</Popover>
|
|
|
|
<Popover placement="top" title={text} overlay={content} trigger="click">
|
2015-10-08 15:13:04 +08:00
|
|
|
<Button>上</Button>
|
2015-06-17 16:58:13 +08:00
|
|
|
</Popover>
|
2015-09-28 21:02:04 +08:00
|
|
|
<Popover placement="topRight" title={text} overlay={content} trigger="click">
|
2015-11-04 17:50:49 +08:00
|
|
|
<Button>上右</Button>
|
2015-09-28 21:02:04 +08:00
|
|
|
</Popover>
|
|
|
|
<br/>
|
|
|
|
<Popover placement="bottomLeft" title={text} overlay={content} trigger="click">
|
2015-11-04 17:50:49 +08:00
|
|
|
<Button>下左</Button>
|
2015-09-28 21:02:04 +08:00
|
|
|
</Popover>
|
|
|
|
<Popover placement="bottom" title={text} overlay={content} trigger="click">
|
2015-10-08 15:13:04 +08:00
|
|
|
<Button>下</Button>
|
2015-06-17 16:58:13 +08:00
|
|
|
</Popover>
|
2015-09-28 21:02:04 +08:00
|
|
|
<Popover placement="bottomRight" title={text} overlay={content} trigger="click">
|
2015-11-04 17:50:49 +08:00
|
|
|
<Button>下右</Button>
|
2015-09-28 21:02:04 +08:00
|
|
|
</Popover>
|
|
|
|
<br/>
|
|
|
|
<Popover placement="rightTop" title={text} overlay={content} trigger="click">
|
2015-11-04 17:50:49 +08:00
|
|
|
<Button>右上</Button>
|
2015-09-28 21:02:04 +08:00
|
|
|
</Popover>
|
|
|
|
<Popover placement="right" title={text} overlay={content} trigger="click">
|
2015-10-08 15:13:04 +08:00
|
|
|
<Button>右</Button>
|
2015-08-17 17:55:39 +08:00
|
|
|
</Popover>
|
2015-09-28 21:02:04 +08:00
|
|
|
<Popover placement="rightBottom" title={text} overlay={content} trigger="click">
|
2015-11-04 17:50:49 +08:00
|
|
|
<Button>右下</Button>
|
2015-09-28 21:02:04 +08:00
|
|
|
</Popover>
|
2015-06-17 16:58:13 +08:00
|
|
|
</div>, document.getElementById('components-popover-demo-placement'));
|
|
|
|
````
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.code-box-demo .ant-btn {
|
|
|
|
margin-right: 1em;
|
2015-09-28 21:02:04 +08:00
|
|
|
margin-bottom: 1em;
|
2015-06-17 16:58:13 +08:00
|
|
|
}
|
|
|
|
</style>
|