Merge pull request #3619 from ChuanfengZhang/2.0

Fix that popper.js' props 'offset' doesn't work
This commit is contained in:
Aresn 2018-05-16 14:24:42 +08:00 committed by GitHub
commit 1ba0bb6eee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View file

@ -90,14 +90,14 @@ export default {
if (!options.modifiers.offset) { if (!options.modifiers.offset) {
options.modifiers.offset = {}; options.modifiers.offset = {};
} }
options.modifiers.offset = this.offset; options.modifiers.offset.offset = this.offset;
options.onCreate =()=>{ options.onCreate =()=>{
this.$nextTick(this.updatePopper); this.$nextTick(this.updatePopper);
this.$emit('created', this); this.$emit('created', this);
}; };
this.popperJS = new Popper(reference, popper, options); this.popperJS = new Popper(reference, popper, options);
}, },
updatePopper() { updatePopper() {
if (isServer) return; if (isServer) return;
@ -112,7 +112,7 @@ export default {
}, },
updated (){ updated (){
this.$nextTick(()=>this.updatePopper()); this.$nextTick(()=>this.updatePopper());
}, },
beforeDestroy() { beforeDestroy() {
if (isServer) return; if (isServer) return;

View file

@ -69,6 +69,7 @@
bottom: 1px; bottom: 1px;
margin-left: -@poptip-arrow-width; margin-left: -@poptip-arrow-width;
border-bottom-width: 0; border-bottom-width: 0;
border-top-width: @poptip-arrow-width;
border-top-color: #fff; border-top-color: #fff;
} }
@ -77,6 +78,7 @@
left: 1px; left: 1px;
bottom: -@poptip-arrow-width; bottom: -@poptip-arrow-width;
border-left-width: 0; border-left-width: 0;
border-right-width: @poptip-arrow-width;
border-right-color: #fff; border-right-color: #fff;
} }
@ -85,6 +87,7 @@
top: 1px; top: 1px;
margin-left: -@poptip-arrow-width; margin-left: -@poptip-arrow-width;
border-top-width: 0; border-top-width: 0;
border-bottom-width: @poptip-arrow-width;
border-bottom-color: #fff; border-bottom-color: #fff;
} }
@ -92,6 +95,7 @@
content: " "; content: " ";
right: 1px; right: 1px;
border-right-width: 0; border-right-width: 0;
border-left-width: @poptip-arrow-width;
border-left-color: #fff; border-left-color: #fff;
bottom: -@poptip-arrow-width; bottom: -@poptip-arrow-width;
} }