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 | 90 | if (!options.modifiers.offset) { |
| 91 | 91 | options.modifiers.offset = {}; |
| 92 | 92 | } |
| 93 | - options.modifiers.offset = this.offset; | |
| 93 | + options.modifiers.offset.offset = this.offset; | |
| 94 | 94 | options.onCreate =()=>{ |
| 95 | 95 | this.$nextTick(this.updatePopper); |
| 96 | 96 | this.$emit('created', this); |
| 97 | 97 | }; |
| 98 | 98 | |
| 99 | 99 | this.popperJS = new Popper(reference, popper, options); |
| 100 | - | |
| 100 | + | |
| 101 | 101 | }, |
| 102 | 102 | updatePopper() { |
| 103 | 103 | if (isServer) return; |
| ... | ... | @@ -112,7 +112,7 @@ export default { |
| 112 | 112 | }, |
| 113 | 113 | updated (){ |
| 114 | 114 | this.$nextTick(()=>this.updatePopper()); |
| 115 | - | |
| 115 | + | |
| 116 | 116 | }, |
| 117 | 117 | beforeDestroy() { |
| 118 | 118 | if (isServer) return; | ... | ... |
src/styles/components/poptip.less
| ... | ... | @@ -69,6 +69,7 @@ |
| 69 | 69 | bottom: 1px; |
| 70 | 70 | margin-left: -@poptip-arrow-width; |
| 71 | 71 | border-bottom-width: 0; |
| 72 | + border-top-width: @poptip-arrow-width; | |
| 72 | 73 | border-top-color: #fff; |
| 73 | 74 | } |
| 74 | 75 | |
| ... | ... | @@ -77,6 +78,7 @@ |
| 77 | 78 | left: 1px; |
| 78 | 79 | bottom: -@poptip-arrow-width; |
| 79 | 80 | border-left-width: 0; |
| 81 | + border-right-width: @poptip-arrow-width; | |
| 80 | 82 | border-right-color: #fff; |
| 81 | 83 | } |
| 82 | 84 | |
| ... | ... | @@ -85,6 +87,7 @@ |
| 85 | 87 | top: 1px; |
| 86 | 88 | margin-left: -@poptip-arrow-width; |
| 87 | 89 | border-top-width: 0; |
| 90 | + border-bottom-width: @poptip-arrow-width; | |
| 88 | 91 | border-bottom-color: #fff; |
| 89 | 92 | } |
| 90 | 93 | |
| ... | ... | @@ -92,6 +95,7 @@ |
| 92 | 95 | content: " "; |
| 93 | 96 | right: 1px; |
| 94 | 97 | border-right-width: 0; |
| 98 | + border-left-width: @poptip-arrow-width; | |
| 95 | 99 | border-left-color: #fff; |
| 96 | 100 | bottom: -@poptip-arrow-width; |
| 97 | 101 | } | ... | ... |