ant-design-vue/components/popover/demo/placement.md

164 lines
3.8 KiB
Markdown
Raw Normal View History

2018-04-16 13:54:37 +00:00
<cn>
#### 位置
位置有十二个方向。
</cn>
<us>
#### Placement
There are 12 `placement` options available.
</us>
```html
2018-01-12 08:10:41 +00:00
<template>
<div id="components-popover-demo-placement">
<div :style="{ marginLeft: `${buttonWidth}px`, whiteSpace: 'nowrap' }">
2018-04-16 13:54:37 +00:00
<a-popover placement="topLeft">
2018-01-12 08:10:41 +00:00
<template slot="content">
2018-01-19 10:01:43 +00:00
<p>Content</p>
<p>Content</p>
2018-01-12 08:10:41 +00:00
</template>
<template slot="title">
<span>Title</span>
</template>
2018-01-23 10:55:39 +00:00
<a-button>TL</a-button>
2018-04-16 13:54:37 +00:00
</a-popover>
<a-popover placement="top">
2018-01-12 08:10:41 +00:00
<template slot="content">
2018-01-19 10:01:43 +00:00
<p>Content</p>
<p>Content</p>
2018-01-12 08:10:41 +00:00
</template>
<template slot="title">
<span>Title</span>
</template>
2018-01-23 10:55:39 +00:00
<a-button>Top</a-button>
2018-04-16 13:54:37 +00:00
</a-popover>
<a-popover placement="topRight">
2018-01-12 08:10:41 +00:00
<template slot="content">
2018-01-19 10:01:43 +00:00
<p>Content</p>
<p>Content</p>
2018-01-12 08:10:41 +00:00
</template>
<template slot="title">
<span>Title</span>
</template>
2018-01-23 10:55:39 +00:00
<a-button>TR</a-button>
2018-04-16 13:54:37 +00:00
</a-popover>
2018-01-12 08:10:41 +00:00
</div>
<div :style="{ width: `${buttonWidth}px`, float: 'left' }">
2018-04-16 13:54:37 +00:00
<a-popover placement="leftTop">
2018-01-12 08:10:41 +00:00
<template slot="content">
2018-01-19 10:01:43 +00:00
<p>Content</p>
<p>Content</p>
2018-01-12 08:10:41 +00:00
</template>
<template slot="title">
<span>Title</span>
</template>
2018-01-23 10:55:39 +00:00
<a-button>LT</a-button>
2018-04-16 13:54:37 +00:00
</a-popover>
<a-popover placement="left">
2018-01-12 08:10:41 +00:00
<template slot="content">
2018-01-19 10:01:43 +00:00
<p>Content</p>
<p>Content</p>
2018-01-12 08:10:41 +00:00
</template>
<template slot="title">
<span>Title</span>
</template>
2018-01-23 10:55:39 +00:00
<a-button>Left</a-button>
2018-04-16 13:54:37 +00:00
</a-popover>
<a-popover placement="leftBottom">
2018-01-12 08:10:41 +00:00
<template slot="content">
2018-01-19 10:01:43 +00:00
<p>Content</p>
<p>Content</p>
2018-01-12 08:10:41 +00:00
</template>
<template slot="title">
<span>Title</span>
</template>
2018-01-23 10:55:39 +00:00
<a-button>LB</a-button>
2018-04-16 13:54:37 +00:00
</a-popover>
2018-01-12 08:10:41 +00:00
</div>
<div :style="{ width: `${buttonWidth}px`, marginLeft: `${buttonWidth * 4 + 24 }px`}">
2018-04-16 13:54:37 +00:00
<a-popover placement="rightTop">
2018-01-12 08:10:41 +00:00
<template slot="content">
2018-01-19 10:01:43 +00:00
<p>Content</p>
<p>Content</p>
2018-01-12 08:10:41 +00:00
</template>
<template slot="title">
<span>Title</span>
</template>
2018-01-23 10:55:39 +00:00
<a-button>RT</a-button>
2018-04-16 13:54:37 +00:00
</a-popover>
<a-popover placement="right">
2018-01-12 08:10:41 +00:00
<template slot="content">
2018-01-19 10:01:43 +00:00
<p>Content</p>
<p>Content</p>
2018-01-12 08:10:41 +00:00
</template>
<template slot="title">
<span>Title</span>
</template>
2018-01-23 10:55:39 +00:00
<a-button>Right</a-button>
2018-04-16 13:54:37 +00:00
</a-popover>
<a-popover placement="rightBottom">
2018-01-12 08:10:41 +00:00
<template slot="content">
2018-01-19 10:01:43 +00:00
<p>Content</p>
<p>Content</p>
2018-01-12 08:10:41 +00:00
</template>
<template slot="title">
<span>Title</span>
</template>
2018-01-23 10:55:39 +00:00
<a-button>RB</a-button>
2018-04-16 13:54:37 +00:00
</a-popover>
2018-01-12 08:10:41 +00:00
</div>
<div :style="{ marginLeft: `${buttonWidth}px`, clear: 'both', whiteSpace: 'nowrap' }">
2018-04-16 13:54:37 +00:00
<a-popover placement="bottomLeft">
2018-01-12 08:10:41 +00:00
<template slot="content">
2018-01-19 10:01:43 +00:00
<p>Content</p>
<p>Content</p>
2018-01-12 08:10:41 +00:00
</template>
<template slot="title">
<span>Title</span>
</template>
2018-01-23 10:55:39 +00:00
<a-button>BL</a-button>
2018-04-16 13:54:37 +00:00
</a-popover>
<a-popover placement="bottom">
2018-01-12 08:10:41 +00:00
<template slot="content">
2018-01-19 10:01:43 +00:00
<p>Content</p>
<p>Content</p>
2018-01-12 08:10:41 +00:00
</template>
<template slot="title">
<span>Title</span>
</template>
2018-01-23 10:55:39 +00:00
<a-button>Bottom</a-button>
2018-04-16 13:54:37 +00:00
</a-popover>
<a-popover placement="bottomRight">
2018-01-12 08:10:41 +00:00
<template slot="content">
2018-01-19 10:01:43 +00:00
<p>Content</p>
<p>Content</p>
2018-01-12 08:10:41 +00:00
</template>
<template slot="title">
<span>Title</span>
</template>
2018-01-23 10:55:39 +00:00
<a-button>BR</a-button>
2018-04-16 13:54:37 +00:00
</a-popover>
2018-01-12 08:10:41 +00:00
</div>
</div>
</template>
<script>
export default {
data () {
return {
buttonWidth: 70,
}
},
}
</script>
<style>
#components-popover-demo-placement .ant-btn {
width: 70px;
text-align: center;
padding: 0;
margin-right: 8px;
margin-bottom: 8px;
}
</style>
2018-04-16 13:54:37 +00:00
```