2016-03-31 09:40:55 +08:00
|
|
|
---
|
|
|
|
order: 1
|
2016-08-02 16:06:46 +08:00
|
|
|
title:
|
|
|
|
zh-CN: 位置
|
|
|
|
en-US: Placement
|
2016-03-31 09:40:55 +08:00
|
|
|
---
|
2015-06-03 17:08:43 +08:00
|
|
|
|
2016-08-02 16:06:46 +08:00
|
|
|
## zh-CN
|
|
|
|
|
2015-11-03 13:50:36 +08:00
|
|
|
位置有 12 个方向。
|
2015-06-03 17:08:43 +08:00
|
|
|
|
2016-08-02 16:06:46 +08:00
|
|
|
## en-US
|
|
|
|
|
|
|
|
The ToolTip has 12 placements choice.
|
|
|
|
|
2017-01-19 15:19:03 +08:00
|
|
|
````__react
|
2015-10-28 20:55:49 +08:00
|
|
|
import { Tooltip } from 'antd';
|
2016-08-02 16:06:46 +08:00
|
|
|
const text = <span>prompt text</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>
|
2016-01-27 16:44:50 +08:00
|
|
|
<div style={{ marginLeft: 60 }}>
|
2015-11-04 19:32:54 +08:00
|
|
|
<Tooltip placement="topLeft" title={text}>
|
2016-09-14 10:20:42 +08:00
|
|
|
<a href="#">TL</a>
|
2015-11-04 19:32:54 +08:00
|
|
|
</Tooltip>
|
|
|
|
<Tooltip placement="top" title={text}>
|
2016-09-14 10:20:42 +08:00
|
|
|
<a href="#">Top</a>
|
2015-11-04 19:32:54 +08:00
|
|
|
</Tooltip>
|
|
|
|
<Tooltip placement="topRight" title={text}>
|
2016-09-14 10:20:42 +08:00
|
|
|
<a href="#">TR</a>
|
2015-11-04 19:32:54 +08:00
|
|
|
</Tooltip>
|
|
|
|
</div>
|
2016-01-27 16:44:50 +08:00
|
|
|
<div style={{ width: 60, float: 'left' }}>
|
2015-11-04 19:32:54 +08:00
|
|
|
<Tooltip placement="leftTop" title={text}>
|
2016-09-14 10:20:42 +08:00
|
|
|
<a href="#">LT</a>
|
2015-11-04 19:32:54 +08:00
|
|
|
</Tooltip>
|
|
|
|
<Tooltip placement="left" title={text}>
|
2016-09-14 10:20:42 +08:00
|
|
|
<a href="#">Left</a>
|
2015-11-04 19:32:54 +08:00
|
|
|
</Tooltip>
|
|
|
|
<Tooltip placement="leftBottom" title={text}>
|
2016-09-14 10:20:42 +08:00
|
|
|
<a href="#">LB</a>
|
2015-11-04 19:32:54 +08:00
|
|
|
</Tooltip>
|
|
|
|
</div>
|
2016-01-27 16:44:50 +08:00
|
|
|
<div style={{ width: 60, marginLeft: 270 }}>
|
2015-11-04 19:32:54 +08:00
|
|
|
<Tooltip placement="rightTop" title={text}>
|
2016-09-14 10:20:42 +08:00
|
|
|
<a href="#">RT</a>
|
2015-11-04 19:32:54 +08:00
|
|
|
</Tooltip>
|
|
|
|
<Tooltip placement="right" title={text}>
|
2016-09-14 10:20:42 +08:00
|
|
|
<a href="#">Right</a>
|
2015-11-04 19:32:54 +08:00
|
|
|
</Tooltip>
|
|
|
|
<Tooltip placement="rightBottom" title={text}>
|
2016-09-14 10:20:42 +08:00
|
|
|
<a href="#">RB</a>
|
2015-11-04 19:32:54 +08:00
|
|
|
</Tooltip>
|
|
|
|
</div>
|
2016-01-27 16:44:50 +08:00
|
|
|
<div style={{ marginLeft: 60, clear: 'both' }}>
|
2015-11-04 19:32:54 +08:00
|
|
|
<Tooltip placement="bottomLeft" title={text}>
|
2016-09-14 10:20:42 +08:00
|
|
|
<a href="#">BL</a>
|
2015-11-04 19:32:54 +08:00
|
|
|
</Tooltip>
|
|
|
|
<Tooltip placement="bottom" title={text}>
|
2016-09-14 10:20:42 +08:00
|
|
|
<a href="#">Bottom</a>
|
2015-11-04 19:32:54 +08:00
|
|
|
</Tooltip>
|
|
|
|
<Tooltip placement="bottomRight" title={text}>
|
2016-09-14 10:20:42 +08:00
|
|
|
<a href="#">BR</a>
|
2015-11-04 19:32:54 +08:00
|
|
|
</Tooltip>
|
|
|
|
</div>
|
2015-06-03 20:43:03 +08:00
|
|
|
</div>
|
2015-12-29 12:08:58 +08:00
|
|
|
, mountNode);
|
2015-06-03 17:08:43 +08:00
|
|
|
````
|
2015-06-03 20:43:03 +08:00
|
|
|
|
|
|
|
<style>
|
2016-09-14 10:20:42 +08:00
|
|
|
#components-tooltip-demo-placement .code-box-demo a {
|
2015-11-03 14:25:34 +08:00
|
|
|
display: inline-block;
|
2015-11-04 19:32:54 +08:00
|
|
|
line-height: 32px;
|
|
|
|
height: 32px;
|
2015-11-04 20:48:51 +08:00
|
|
|
width: 60px;
|
|
|
|
font-size: 14px;
|
2015-11-03 14:25:34 +08:00
|
|
|
text-align: center;
|
2015-11-04 19:32:54 +08:00
|
|
|
background: #f5f5f5;
|
2015-06-03 20:43:03 +08:00
|
|
|
margin-right: 1em;
|
2015-11-03 14:25:34 +08:00
|
|
|
margin-bottom: 1em;
|
|
|
|
border-radius: 6px;
|
2015-06-03 20:43:03 +08:00
|
|
|
}
|
|
|
|
</style>
|