2018-03-22 10:19:12 +00:00
|
|
|
<cn>
|
|
|
|
#### 自动调整位置
|
|
|
|
气泡框不可见时自动调整位置
|
|
|
|
</cn>
|
|
|
|
|
|
|
|
<us>
|
|
|
|
#### Adjust placement automatically
|
|
|
|
Adjust popup placement automatically when popup is invisible
|
|
|
|
</us>
|
|
|
|
|
2019-10-09 10:32:23 +00:00
|
|
|
```tpl
|
2018-01-11 10:53:51 +00:00
|
|
|
<template>
|
|
|
|
<div :style="wrapStyles">
|
2018-03-22 10:19:12 +00:00
|
|
|
<a-tooltip placement="left" title="Prompt Text" :getPopupContainer="getPopupContainer">
|
2018-01-23 10:55:39 +00:00
|
|
|
<a-button>Adjust automatically / 自动调整</a-button>
|
2018-03-22 10:19:12 +00:00
|
|
|
</a-tooltip>
|
2018-01-11 10:53:51 +00:00
|
|
|
<br />
|
2019-09-28 12:45:07 +00:00
|
|
|
<a-tooltip
|
|
|
|
style="marginTop: 10px"
|
|
|
|
placement="left"
|
|
|
|
title="Prompt Text"
|
|
|
|
:getPopupContainer="getPopupContainer"
|
|
|
|
:autoAdjustOverflow="false"
|
|
|
|
>
|
2018-01-23 10:55:39 +00:00
|
|
|
<a-button>Ingore / 不处理</a-button>
|
2018-03-22 10:19:12 +00:00
|
|
|
</a-tooltip>
|
2018-01-11 10:53:51 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
2019-09-28 12:45:07 +00:00
|
|
|
const wrapStyles = {
|
|
|
|
overflow: 'hidden',
|
|
|
|
position: 'relative',
|
|
|
|
padding: '24px',
|
|
|
|
border: '1px solid #e9e9e9',
|
|
|
|
};
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
wrapStyles,
|
|
|
|
};
|
2018-01-11 10:53:51 +00:00
|
|
|
},
|
2019-09-28 12:45:07 +00:00
|
|
|
methods: {
|
|
|
|
getPopupContainer(trigger) {
|
|
|
|
return trigger.parentElement;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2018-01-11 10:53:51 +00:00
|
|
|
</script>
|
2018-03-22 10:19:12 +00:00
|
|
|
```
|