diff --git a/examples/routers/poptip.vue b/examples/routers/poptip.vue index 5f7d2415..3ce19f2c 100644 --- a/examples/routers/poptip.vue +++ b/examples/routers/poptip.vue @@ -2,10 +2,19 @@
-
- +
+ + + + + + + + + +
标签二的内容 @@ -17,11 +26,7 @@ data () { return { options: { - modifiers: { - preventOverflow: { - boundariesElement: 'body', - } - } + } } } diff --git a/src/components/base/popper.js b/src/components/base/popper.js index ecf15ea9..5b5d4e4b 100644 --- a/src/components/base/popper.js +++ b/src/components/base/popper.js @@ -32,6 +32,9 @@ export default { modifiers: { computeStyle:{ gpuAcceleration: false, + }, + preventOverflow :{ + boundariesElement: 'body' } } }; @@ -83,11 +86,8 @@ export default { } options.placement = this.placement; - - if (options.modifiers) { - options.modifiers = {}; - } - if (options.modifiers.offset) { + + if (!options.modifiers.offset) { options.modifiers.offset = {}; } options.modifiers.offset = this.offset;