2016-08-31 13:50:50 +08:00
|
|
|
---
|
|
|
|
order: 4
|
2016-09-29 13:43:55 +08:00
|
|
|
title:
|
|
|
|
zh-CN: 箭头指向
|
|
|
|
en-US: Arrow pointing
|
2016-08-31 13:50:50 +08:00
|
|
|
---
|
|
|
|
|
2016-09-29 13:43:55 +08:00
|
|
|
## zh-CN
|
|
|
|
|
2016-08-31 13:50:50 +08:00
|
|
|
设置了 `arrowPointAtCenter` 后,箭头将指向目标元素的中心。
|
|
|
|
|
2016-09-29 13:43:55 +08:00
|
|
|
## en-US
|
|
|
|
|
|
|
|
The arrow points to the center of the target element, which set `arrowPointAtCenter`.
|
|
|
|
|
2017-02-13 10:55:53 +08:00
|
|
|
````jsx
|
2016-08-31 13:50:50 +08:00
|
|
|
import { Popover, Button } from 'antd';
|
|
|
|
|
2016-09-29 13:43:55 +08:00
|
|
|
const text = <span>Title</span>;
|
2016-08-31 13:50:50 +08:00
|
|
|
const content = (
|
|
|
|
<div>
|
2016-09-29 13:43:55 +08:00
|
|
|
<p>Content</p>
|
|
|
|
<p>Content</p>
|
2016-08-31 13:50:50 +08:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
|
|
|
ReactDOM.render(
|
|
|
|
<div>
|
|
|
|
<Popover placement="topLeft" title={text} content={content}>
|
2016-10-07 15:20:10 +08:00
|
|
|
<Button>Align edge / 边缘对齐</Button>
|
2016-08-31 13:50:50 +08:00
|
|
|
</Popover>
|
|
|
|
<Popover placement="topLeft" title={text} content={content} arrowPointAtCenter>
|
2016-10-07 15:20:10 +08:00
|
|
|
<Button>Arrow points to center / 箭头指向中心</Button>
|
2016-08-31 13:50:50 +08:00
|
|
|
</Popover>
|
|
|
|
</div>
|
|
|
|
, mountNode);
|
|
|
|
````
|