2015-06-03 17:08:43 +08:00
|
|
|
# 位置
|
|
|
|
|
|
|
|
- order: 1
|
|
|
|
|
2015-11-03 13:50:36 +08:00
|
|
|
位置有 12 个方向。
|
2015-06-03 17:08:43 +08:00
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
````jsx
|
2015-10-28 20:55:49 +08:00
|
|
|
import { Tooltip } from 'antd';
|
|
|
|
const text = <span>提示文字</span>;
|
2015-06-03 17:08:43 +08:00
|
|
|
|
2015-10-20 16:47:55 +08:00
|
|
|
ReactDOM.render(
|
2015-06-03 20:43:03 +08:00
|
|
|
<div>
|
2015-11-03 13:50:36 +08:00
|
|
|
<div style={{margin:10}}>
|
|
|
|
<Tooltip placement="left" title={text}>
|
|
|
|
<a href="#">左边 要对齐</a>
|
|
|
|
</Tooltip>
|
|
|
|
<Tooltip placement="top" title={text}>
|
|
|
|
<a href="#">上边 要对齐</a>
|
|
|
|
</Tooltip>
|
|
|
|
<Tooltip placement="bottom" title={text}>
|
|
|
|
<a href="#">下边 要对齐</a>
|
|
|
|
</Tooltip>
|
|
|
|
<Tooltip placement="right" title={text}>
|
|
|
|
<a href="#">右边 要对齐</a>
|
|
|
|
</Tooltip>
|
|
|
|
</div>
|
|
|
|
<div style={{margin:10}}>
|
|
|
|
<Tooltip placement="leftTop" title={text}>
|
|
|
|
<a href="#">左上 要对齐</a>
|
|
|
|
</Tooltip>
|
|
|
|
<Tooltip placement="leftBottom" title={text}>
|
|
|
|
<a href="#">左下 要对齐</a>
|
|
|
|
</Tooltip>
|
|
|
|
<Tooltip placement="rightTop" title={text}>
|
|
|
|
<a href="#">右上 要对齐</a>
|
|
|
|
</Tooltip>
|
|
|
|
<Tooltip placement="rightBottom" title={text}>
|
|
|
|
<a href="#">右下 要对齐</a>
|
|
|
|
</Tooltip>
|
|
|
|
</div>
|
|
|
|
<div style={{margin:10}}>
|
|
|
|
<Tooltip placement="topLeft" title={text}>
|
|
|
|
<a href="#">上左 要对齐</a>
|
|
|
|
</Tooltip>
|
|
|
|
<Tooltip placement="topRight" title={text}>
|
|
|
|
<a href="#">上右 要对齐</a>
|
|
|
|
</Tooltip>
|
|
|
|
<Tooltip placement="bottomLeft" title={text}>
|
|
|
|
<a href="#">下左 要对齐</a>
|
|
|
|
</Tooltip>
|
|
|
|
<Tooltip placement="bottomRight" title={text}>
|
|
|
|
<a href="#">下右 要对齐</a>
|
|
|
|
</Tooltip>
|
|
|
|
</div>
|
2015-06-03 20:43:03 +08:00
|
|
|
</div>
|
2015-06-03 17:08:43 +08:00
|
|
|
, document.getElementById('components-tooltip-demo-placement'));
|
|
|
|
````
|
2015-06-03 20:43:03 +08:00
|
|
|
|
|
|
|
<style>
|
|
|
|
#components-tooltip-demo-placement a {
|
|
|
|
margin-right: 1em;
|
|
|
|
}
|
|
|
|
</style>
|