2016-03-31 09:40:55 +08:00
|
|
|
---
|
|
|
|
order: 1
|
|
|
|
title: 位置
|
|
|
|
---
|
2015-06-17 16:58:13 +08:00
|
|
|
|
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>;
|
2016-01-07 16:29:12 +08:00
|
|
|
const content = (
|
2016-04-29 12:13:27 +08:00
|
|
|
<div>
|
|
|
|
<p>内容</p>
|
|
|
|
<p>内容</p>
|
|
|
|
</div>
|
2016-01-07 16:29:12 +08:00
|
|
|
);
|
2015-06-17 16:58:13 +08:00
|
|
|
|
2016-01-07 16:29:12 +08:00
|
|
|
ReactDOM.render(
|
|
|
|
<div>
|
2016-01-27 16:44:50 +08:00
|
|
|
<div style={{ marginLeft: 60 }}>
|
2016-04-01 14:28:35 +08:00
|
|
|
<Popover placement="topLeft" title={text} content={content} trigger="click">
|
2016-01-07 16:29:12 +08:00
|
|
|
<Button>上左</Button>
|
|
|
|
</Popover>
|
2016-04-01 14:28:35 +08:00
|
|
|
<Popover placement="top" title={text} content={content} trigger="click">
|
2016-01-07 16:29:12 +08:00
|
|
|
<Button>上边</Button>
|
|
|
|
</Popover>
|
2016-04-01 14:28:35 +08:00
|
|
|
<Popover placement="topRight" title={text} content={content} trigger="click">
|
2016-01-07 16:29:12 +08:00
|
|
|
<Button>上右</Button>
|
|
|
|
</Popover>
|
|
|
|
</div>
|
2016-01-27 16:44:50 +08:00
|
|
|
<div style={{ width: 60, float: 'left' }}>
|
2016-04-01 14:28:35 +08:00
|
|
|
<Popover placement="leftTop" title={text} content={content} trigger="click">
|
2016-01-07 16:29:12 +08:00
|
|
|
<Button>左上</Button>
|
|
|
|
</Popover>
|
2016-04-01 14:28:35 +08:00
|
|
|
<Popover placement="left" title={text} content={content} trigger="click">
|
2016-01-07 16:29:12 +08:00
|
|
|
<Button>左边</Button>
|
|
|
|
</Popover>
|
2016-04-01 14:28:35 +08:00
|
|
|
<Popover placement="leftBottom" title={text} content={content} trigger="click">
|
2016-01-07 16:29:12 +08:00
|
|
|
<Button>左下</Button>
|
|
|
|
</Popover>
|
|
|
|
</div>
|
2016-01-27 16:44:50 +08:00
|
|
|
<div style={{ width: 60, marginLeft: 270 }}>
|
2016-04-01 14:28:35 +08:00
|
|
|
<Popover placement="rightTop" title={text} content={content} trigger="click">
|
2016-01-07 16:29:12 +08:00
|
|
|
<Button>右上</Button>
|
|
|
|
</Popover>
|
2016-04-01 14:28:35 +08:00
|
|
|
<Popover placement="right" title={text} content={content} trigger="click">
|
2016-01-07 16:29:12 +08:00
|
|
|
<Button>右边</Button>
|
|
|
|
</Popover>
|
2016-04-01 14:28:35 +08:00
|
|
|
<Popover placement="rightBottom" title={text} content={content} trigger="click">
|
2016-01-07 16:29:12 +08:00
|
|
|
<Button>右下</Button>
|
|
|
|
</Popover>
|
|
|
|
</div>
|
2016-01-27 16:44:50 +08:00
|
|
|
<div style={{ marginLeft: 60, clear: 'both' }}>
|
2016-04-01 14:28:35 +08:00
|
|
|
<Popover placement="bottomLeft" title={text} content={content} trigger="click">
|
2016-01-07 16:29:12 +08:00
|
|
|
<Button>下左</Button>
|
|
|
|
</Popover>
|
2016-04-01 14:28:35 +08:00
|
|
|
<Popover placement="bottom" title={text} content={content} trigger="click">
|
2016-01-07 16:29:12 +08:00
|
|
|
<Button>下边</Button>
|
|
|
|
</Popover>
|
2016-04-01 14:28:35 +08:00
|
|
|
<Popover placement="bottomRight" title={text} content={content} trigger="click">
|
2016-01-07 16:29:12 +08:00
|
|
|
<Button>下右</Button>
|
|
|
|
</Popover>
|
|
|
|
</div>
|
2015-11-04 20:48:51 +08:00
|
|
|
</div>
|
2016-01-07 16:29:12 +08:00
|
|
|
, mountNode);
|
2015-06-17 16:58:13 +08:00
|
|
|
````
|
|
|
|
|
|
|
|
<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>
|