Commit 694378a57c16342683448ea2338cd7803b44893b
Committed by
GitHub
Merge pull request #3343 from iview/pr/3342
Pr/3342
Showing
2 changed files
with
17 additions
and
12 deletions
Show diff stats
examples/routers/poptip.vue
... | ... | @@ -2,10 +2,19 @@ |
2 | 2 | <div style="margin: 200px"> |
3 | 3 | <Tabs value="name1"> |
4 | 4 | <TabPane label="标签一" name="name1"> |
5 | - <div style="overflow: auto;width: 200px;height:300px"> | |
6 | - <Poptip title="提示标题" content="标签一的内容" placement="right" transfer :options="options"> | |
5 | + <div style="width: 200px;height:300px"> | |
6 | + <Poptip title="提示标题" content="标签一的内容" placement="left" transfer > | |
7 | + <Button id="aaa">左边</Button> | |
8 | + </Poptip> | |
9 | + <Poptip title="提示标题" content="标签一的内容" placement="right" transfer> | |
7 | 10 | <Button id="aaa">右边</Button> |
8 | 11 | </Poptip> |
12 | + <Poptip title="提示标题" content="标签一的内容" placement="top" transfer> | |
13 | + <Button id="aaa">上边</Button> | |
14 | + </Poptip> | |
15 | + <Poptip title="提示标题" content="标签一的内容" placement="bottom" transfer> | |
16 | + <Button id="aaa">下边</Button> | |
17 | + </Poptip> | |
9 | 18 | </div> |
10 | 19 | </TabPane> |
11 | 20 | <TabPane label="标签二" name="name2">标签二的内容</TabPane> |
... | ... | @@ -17,11 +26,7 @@ |
17 | 26 | data () { |
18 | 27 | return { |
19 | 28 | options: { |
20 | - modifiers: { | |
21 | - preventOverflow: { | |
22 | - boundariesElement: 'body', | |
23 | - } | |
24 | - } | |
29 | + | |
25 | 30 | } |
26 | 31 | } |
27 | 32 | } | ... | ... |
src/components/base/popper.js
... | ... | @@ -32,6 +32,9 @@ export default { |
32 | 32 | modifiers: { |
33 | 33 | computeStyle:{ |
34 | 34 | gpuAcceleration: false, |
35 | + }, | |
36 | + preventOverflow :{ | |
37 | + boundariesElement: 'body' | |
35 | 38 | } |
36 | 39 | } |
37 | 40 | }; |
... | ... | @@ -83,11 +86,8 @@ export default { |
83 | 86 | } |
84 | 87 | |
85 | 88 | options.placement = this.placement; |
86 | - | |
87 | - if (options.modifiers) { | |
88 | - options.modifiers = {}; | |
89 | - } | |
90 | - if (options.modifiers.offset) { | |
89 | + | |
90 | + if (!options.modifiers.offset) { | |
91 | 91 | options.modifiers.offset = {}; |
92 | 92 | } |
93 | 93 | options.modifiers.offset = this.offset; | ... | ... |