Tooltip: fix appear in the wrong place

This commit is contained in:
qingwei.li 2016-09-13 21:56:20 +08:00
parent ed79d85379
commit 80fe4ce1f3
5 changed files with 7 additions and 14 deletions

View File

@ -6,6 +6,7 @@
- 修复 Select 多选时选项变为空数组后 placeholder 不出现的问题 - 修复 Select 多选时选项变为空数组后 placeholder 不出现的问题
- 修复 TimePicker 时间选择可滚动 - 修复 TimePicker 时间选择可滚动
- 修复 Tooltip 会有出现错位的情况
#### 非兼容性更新 #### 非兼容性更新
- Select 组件样式的 `display` 属性默认值修改为 `block` - Select 组件样式的 `display` 属性默认值修改为 `block`

View File

@ -68,12 +68,11 @@
"theaterjs": "^3.0.0", "theaterjs": "^3.0.0",
"uppercamelcase": "^1.1.0", "uppercamelcase": "^1.1.0",
"url-loader": "^0.5.7", "url-loader": "^0.5.7",
"vue": "2.0.0-rc.3", "vue": "^2.0.0-rc.6",
"vue-loader": "9.3.2", "vue-loader": "^9.4.2",
"vue-markdown-loader": "^0.4.0", "vue-markdown-loader": "^0.4.0",
"vue-popup": "^0.2.3", "vue-popup": "^0.2.3",
"vue-router": "^2.0.0-beta.2", "vue-router": "^2.0.0-beta.2",
"vue-template-compiler": "2.0.0-rc.3",
"webpack": "^1.13.2", "webpack": "^1.13.2",
"webpack-dev-server": "^1.15.1", "webpack-dev-server": "^1.15.1",
"wind-dom": "0.0.3" "wind-dom": "0.0.3"

View File

@ -1,6 +1,6 @@
<template> <template>
<span> <span>
<transition :name="transition"> <transition :name="transition" @after-leave="doDestroy">
<div <div
class="el-popover" class="el-popover"
ref="popper" ref="popper"

View File

@ -7,7 +7,7 @@
<slot></slot> <slot></slot>
</div> </div>
<transition :name="transition"> <transition :name="transition" @after-leave="doDestroy">
<div <div
class="el-tooltip__popper" class="el-tooltip__popper"
:class="['is-' + effect]" :class="['is-' + effect]"

View File

@ -1,5 +1,5 @@
import PopperJS from 'main/utils/popper'; import PopperJS from 'main/utils/popper';
import { once } from 'wind-dom/src/event';
/** /**
* @param {HTMLElement} [reference=$refs.reference] - The reference element used to position the popper. * @param {HTMLElement} [reference=$refs.reference] - The reference element used to position the popper.
* @param {HTMLElement} [popper=$refs.popper] - The HTML element used as popper, or a configuration used to generate the popper. * @param {HTMLElement} [popper=$refs.popper] - The HTML element used as popper, or a configuration used to generate the popper.
@ -100,20 +100,13 @@ export default {
doDestroy() { doDestroy() {
if (this.showPopper) return; if (this.showPopper) return;
this.popperJS && this.popperJS.destroy(); this.popperJS.destroy();
this.popperJS = null; this.popperJS = null;
}, },
destroyPopper() { destroyPopper() {
if (this.popperJS) { if (this.popperJS) {
this.resetTransformOrigin(this.popperJS); this.resetTransformOrigin(this.popperJS);
if (this.transition) {
once(this.popperJS._popper, 'webkitTransitionEnd', this.doDestroy);
once(this.popperJS._popper, 'oTransitionend', this.doDestroy);
once(this.popperJS._popper, 'transitionend', this.doDestroy);
} else {
this.doDestroy();
}
} }
}, },