ant-design/components/popconfirm/demo/placement.md

39 lines
866 B
Markdown
Raw Normal View History

2015-06-24 19:20:47 +08:00
# 位置
- order: 1
位置有四个方向。
---
````jsx
var Popconfirm = antd.Popconfirm;
2015-07-17 00:25:03 +08:00
var message = antd.message;
2015-06-24 19:20:47 +08:00
var text = '确认文案';
function confirm() {
2015-07-17 00:25:03 +08:00
message.info('点击了确定');
2015-06-24 19:20:47 +08:00
}
React.render(<div>
<Popconfirm placement="left" title={text} onConfirm={confirm}>
2015-06-26 10:22:08 +08:00
<a href="javascript:;">左边</a>
2015-06-24 19:20:47 +08:00
</Popconfirm>
<Popconfirm placement="right" title={text} onConfirm={confirm}>
2015-06-26 10:22:08 +08:00
<a href="javascript:;">右边</a>
2015-06-24 19:20:47 +08:00
</Popconfirm>
<Popconfirm placement="top" title={text} onConfirm={confirm}>
2015-06-26 10:22:08 +08:00
<a href="javascript:;">上边</a>
2015-06-24 19:20:47 +08:00
</Popconfirm>
<Popconfirm placement="bottom" title={text} onConfirm={confirm}>
2015-06-26 10:22:08 +08:00
<a href="javascript:;">下边</a>
2015-06-24 19:20:47 +08:00
</Popconfirm>
</div>, document.getElementById('components-popconfirm-demo-placement'));
````
<style>
2015-06-26 10:22:08 +08:00
.code-box-demo .ant-popover-wrap > a {
2015-06-24 19:20:47 +08:00
margin-right: 1em;
}
</style>