Commit 1ba0bb6eeed5ace3c7731aca7a742675f41861ab
Committed by
GitHub

Merge pull request #3619 from ChuanfengZhang/2.0
Fix that popper.js' props 'offset' doesn't work
Showing
2 changed files
with
7 additions
and
3 deletions
Show diff stats
src/components/base/popper.js
@@ -90,14 +90,14 @@ export default { | @@ -90,14 +90,14 @@ export default { | ||
90 | if (!options.modifiers.offset) { | 90 | if (!options.modifiers.offset) { |
91 | options.modifiers.offset = {}; | 91 | options.modifiers.offset = {}; |
92 | } | 92 | } |
93 | - options.modifiers.offset = this.offset; | 93 | + options.modifiers.offset.offset = this.offset; |
94 | options.onCreate =()=>{ | 94 | options.onCreate =()=>{ |
95 | this.$nextTick(this.updatePopper); | 95 | this.$nextTick(this.updatePopper); |
96 | this.$emit('created', this); | 96 | this.$emit('created', this); |
97 | }; | 97 | }; |
98 | 98 | ||
99 | this.popperJS = new Popper(reference, popper, options); | 99 | this.popperJS = new Popper(reference, popper, options); |
100 | - | 100 | + |
101 | }, | 101 | }, |
102 | updatePopper() { | 102 | updatePopper() { |
103 | if (isServer) return; | 103 | if (isServer) return; |
@@ -112,7 +112,7 @@ export default { | @@ -112,7 +112,7 @@ export default { | ||
112 | }, | 112 | }, |
113 | updated (){ | 113 | updated (){ |
114 | this.$nextTick(()=>this.updatePopper()); | 114 | this.$nextTick(()=>this.updatePopper()); |
115 | - | 115 | + |
116 | }, | 116 | }, |
117 | beforeDestroy() { | 117 | beforeDestroy() { |
118 | if (isServer) return; | 118 | if (isServer) return; |
src/styles/components/poptip.less
@@ -69,6 +69,7 @@ | @@ -69,6 +69,7 @@ | ||
69 | bottom: 1px; | 69 | bottom: 1px; |
70 | margin-left: -@poptip-arrow-width; | 70 | margin-left: -@poptip-arrow-width; |
71 | border-bottom-width: 0; | 71 | border-bottom-width: 0; |
72 | + border-top-width: @poptip-arrow-width; | ||
72 | border-top-color: #fff; | 73 | border-top-color: #fff; |
73 | } | 74 | } |
74 | 75 | ||
@@ -77,6 +78,7 @@ | @@ -77,6 +78,7 @@ | ||
77 | left: 1px; | 78 | left: 1px; |
78 | bottom: -@poptip-arrow-width; | 79 | bottom: -@poptip-arrow-width; |
79 | border-left-width: 0; | 80 | border-left-width: 0; |
81 | + border-right-width: @poptip-arrow-width; | ||
80 | border-right-color: #fff; | 82 | border-right-color: #fff; |
81 | } | 83 | } |
82 | 84 | ||
@@ -85,6 +87,7 @@ | @@ -85,6 +87,7 @@ | ||
85 | top: 1px; | 87 | top: 1px; |
86 | margin-left: -@poptip-arrow-width; | 88 | margin-left: -@poptip-arrow-width; |
87 | border-top-width: 0; | 89 | border-top-width: 0; |
90 | + border-bottom-width: @poptip-arrow-width; | ||
88 | border-bottom-color: #fff; | 91 | border-bottom-color: #fff; |
89 | } | 92 | } |
90 | 93 | ||
@@ -92,6 +95,7 @@ | @@ -92,6 +95,7 @@ | ||
92 | content: " "; | 95 | content: " "; |
93 | right: 1px; | 96 | right: 1px; |
94 | border-right-width: 0; | 97 | border-right-width: 0; |
98 | + border-left-width: @poptip-arrow-width; | ||
95 | border-left-color: #fff; | 99 | border-left-color: #fff; |
96 | bottom: -@poptip-arrow-width; | 100 | bottom: -@poptip-arrow-width; |
97 | } | 101 | } |