You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ant-design-vue/components/popover/demo/placement.md

164 lines
3.8 KiB

7 years ago
<cn>
#### 位置
位置有十二个方向。
</cn>
<us>
#### Placement
There are 12 `placement` options available.
</us>
```html
7 years ago
<template>
<div id="components-popover-demo-placement">
<div :style="{ marginLeft: `${buttonWidth}px`, whiteSpace: 'nowrap' }">
7 years ago
<a-popover placement="topLeft">
7 years ago
<template slot="content">
7 years ago
<p>Content</p>
<p>Content</p>
7 years ago
</template>
<template slot="title">
<span>Title</span>
</template>
7 years ago
<a-button>TL</a-button>
7 years ago
</a-popover>
<a-popover placement="top">
7 years ago
<template slot="content">
7 years ago
<p>Content</p>
<p>Content</p>
7 years ago
</template>
<template slot="title">
<span>Title</span>
</template>
7 years ago
<a-button>Top</a-button>
7 years ago
</a-popover>
<a-popover placement="topRight">
7 years ago
<template slot="content">
7 years ago
<p>Content</p>
<p>Content</p>
7 years ago
</template>
<template slot="title">
<span>Title</span>
</template>
7 years ago
<a-button>TR</a-button>
7 years ago
</a-popover>
7 years ago
</div>
<div :style="{ width: `${buttonWidth}px`, float: 'left' }">
7 years ago
<a-popover placement="leftTop">
7 years ago
<template slot="content">
7 years ago
<p>Content</p>
<p>Content</p>
7 years ago
</template>
<template slot="title">
<span>Title</span>
</template>
7 years ago
<a-button>LT</a-button>
7 years ago
</a-popover>
<a-popover placement="left">
7 years ago
<template slot="content">
7 years ago
<p>Content</p>
<p>Content</p>
7 years ago
</template>
<template slot="title">
<span>Title</span>
</template>
7 years ago
<a-button>Left</a-button>
7 years ago
</a-popover>
<a-popover placement="leftBottom">
7 years ago
<template slot="content">
7 years ago
<p>Content</p>
<p>Content</p>
7 years ago
</template>
<template slot="title">
<span>Title</span>
</template>
7 years ago
<a-button>LB</a-button>
7 years ago
</a-popover>
7 years ago
</div>
<div :style="{ width: `${buttonWidth}px`, marginLeft: `${buttonWidth * 4 + 24 }px`}">
7 years ago
<a-popover placement="rightTop">
7 years ago
<template slot="content">
7 years ago
<p>Content</p>
<p>Content</p>
7 years ago
</template>
<template slot="title">
<span>Title</span>
</template>
7 years ago
<a-button>RT</a-button>
7 years ago
</a-popover>
<a-popover placement="right">
7 years ago
<template slot="content">
7 years ago
<p>Content</p>
<p>Content</p>
7 years ago
</template>
<template slot="title">
<span>Title</span>
</template>
7 years ago
<a-button>Right</a-button>
7 years ago
</a-popover>
<a-popover placement="rightBottom">
7 years ago
<template slot="content">
7 years ago
<p>Content</p>
<p>Content</p>
7 years ago
</template>
<template slot="title">
<span>Title</span>
</template>
7 years ago
<a-button>RB</a-button>
7 years ago
</a-popover>
7 years ago
</div>
<div :style="{ marginLeft: `${buttonWidth}px`, clear: 'both', whiteSpace: 'nowrap' }">
7 years ago
<a-popover placement="bottomLeft">
7 years ago
<template slot="content">
7 years ago
<p>Content</p>
<p>Content</p>
7 years ago
</template>
<template slot="title">
<span>Title</span>
</template>
7 years ago
<a-button>BL</a-button>
7 years ago
</a-popover>
<a-popover placement="bottom">
7 years ago
<template slot="content">
7 years ago
<p>Content</p>
<p>Content</p>
7 years ago
</template>
<template slot="title">
<span>Title</span>
</template>
7 years ago
<a-button>Bottom</a-button>
7 years ago
</a-popover>
<a-popover placement="bottomRight">
7 years ago
<template slot="content">
7 years ago
<p>Content</p>
<p>Content</p>
7 years ago
</template>
<template slot="title">
<span>Title</span>
</template>
7 years ago
<a-button>BR</a-button>
7 years ago
</a-popover>
7 years ago
</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>
7 years ago
```