update Tooltip

update Tooltip
This commit is contained in:
梁灏 2016-10-26 13:51:05 +08:00
parent bf962a6917
commit 755df66c00
6 changed files with 17 additions and 22 deletions

View file

@ -24,8 +24,9 @@ export default {
type: Object,
default () {
return {
gpuAcceleration: false
};
gpuAcceleration: false,
boundariesElement: 'body'
}
}
}
},
@ -66,24 +67,15 @@ export default {
options.placement = this.placement;
options.offset = this.offset;
this.$nextTick(() => {
this.popperJS = new Popper(
reference,
popper,
options
);
this.popperJS.onCreate(popper => {
this.resetTransformOrigin(popper);
this.$emit('created', this);
});
this.popperJS = new Popper(reference, popper, options);
this.popperJS.onCreate(popper => {
this.resetTransformOrigin(popper);
this.$nextTick(this.updatePopper);
this.$emit('created', this);
});
},
updatePopper() {
if (this.popperJS) {
this.popperJS.update();
} else {
this.createPopper();
}
this.popperJS ? this.popperJS.update() : this.createPopper();
},
doDestroy() {
if (this.showPopper) return;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,7 @@
<style>
.tooltip_out{
border: 1px solid #ccc;
padding: 20px;
padding: 50px;
}
body{
height: 1000px;
@ -13,7 +13,9 @@
123
</div>
<div class="tooltip_out">
<Tooltip content="Top23321" placement="left">
<Button>上面的左面</Button>
</Tooltip>
</div>
<Row>
<i-col span="12">

View file

@ -1,6 +1,6 @@
{
"name": "iview",
"version": "0.9.5-rc-3",
"version": "0.9.5-rc-4",
"title": "iView",
"description": "A high quality UI components Library with Vue.js",
"homepage": "http://www.iviewui.com",

View file

@ -108,6 +108,7 @@
background-color: @tooltip-bg;
border-radius: @border-radius-small;
box-shadow: @shadow-base;
white-space:nowrap;
}
&-arrow{