Commit e8139eac584c427cebb5dc598c93249824f2facb
1 parent
586bf3fc
update popper
Showing
2 changed files
with
17 additions
and
2 deletions
Show diff stats
examples/routers/poptip.vue
@@ -3,9 +3,18 @@ | @@ -3,9 +3,18 @@ | ||
3 | <Tabs value="name1"> | 3 | <Tabs value="name1"> |
4 | <TabPane label="标签一" name="name1"> | 4 | <TabPane label="标签一" name="name1"> |
5 | <div style="overflow: auto;width: 200px;height:300px"> | 5 | <div style="overflow: auto;width: 200px;height:300px"> |
6 | + <Poptip title="提示标题" content="标签一的内容" placement="left" transfer :options="options"> | ||
7 | + <Button id="aaa">左边</Button> | ||
8 | + </Poptip> | ||
6 | <Poptip title="提示标题" content="标签一的内容" placement="right" transfer :options="options"> | 9 | <Poptip title="提示标题" content="标签一的内容" placement="right" transfer :options="options"> |
7 | <Button id="aaa">右边</Button> | 10 | <Button id="aaa">右边</Button> |
8 | </Poptip> | 11 | </Poptip> |
12 | + <Poptip title="提示标题" content="标签一的内容" placement="top" transfer :options="options"> | ||
13 | + <Button id="aaa">上边</Button> | ||
14 | + </Poptip> | ||
15 | + <Poptip title="提示标题" content="标签一的内容" placement="bottom" transfer :options="options"> | ||
16 | + <Button id="aaa">下边</Button> | ||
17 | + </Poptip> | ||
9 | </div> | 18 | </div> |
10 | </TabPane> | 19 | </TabPane> |
11 | <TabPane label="标签二" name="name2">标签二的内容</TabPane> | 20 | <TabPane label="标签二" name="name2">标签二的内容</TabPane> |
src/components/base/popper.js
@@ -33,6 +33,12 @@ export default { | @@ -33,6 +33,12 @@ export default { | ||
33 | computeStyle:{ | 33 | computeStyle:{ |
34 | gpuAcceleration: false, | 34 | gpuAcceleration: false, |
35 | } | 35 | } |
36 | + }, | ||
37 | + preventOverflow :{ | ||
38 | + boundariesElement: 'body', | ||
39 | + }, | ||
40 | + flip :{ | ||
41 | + boundariesElement: 'body', | ||
36 | } | 42 | } |
37 | }; | 43 | }; |
38 | } | 44 | } |
@@ -84,10 +90,10 @@ export default { | @@ -84,10 +90,10 @@ export default { | ||
84 | 90 | ||
85 | options.placement = this.placement; | 91 | options.placement = this.placement; |
86 | 92 | ||
87 | - if (options.modifiers) { | 93 | + if (!options.modifiers) { |
88 | options.modifiers = {}; | 94 | options.modifiers = {}; |
89 | } | 95 | } |
90 | - if (options.modifiers.offset) { | 96 | + if (!options.modifiers.offset) { |
91 | options.modifiers.offset = {}; | 97 | options.modifiers.offset = {}; |
92 | } | 98 | } |
93 | options.modifiers.offset = this.offset; | 99 | options.modifiers.offset = this.offset; |