Commit 81f88959a9353a4920494ac1171e0390ee3afeb5

Authored by 梁灏
1 parent fa446cb9

update Poptip options

Showing 2 changed files with 10 additions and 20 deletions   Show diff stats
examples/routers/poptip.vue
... ... @@ -2,17 +2,17 @@
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="left" transfer :options="options">
  5 + <div style="width: 200px;height:300px">
  6 + <Poptip title="提示标题" content="标签一的内容" placement="left" transfer >
7 7 <Button id="aaa">左边</Button>
8 8 </Poptip>
9   - <Poptip title="提示标题" content="标签一的内容" placement="right" transfer :options="options">
  9 + <Poptip title="提示标题" content="标签一的内容" placement="right" transfer>
10 10 <Button id="aaa">右边</Button>
11 11 </Poptip>
12   - <Poptip title="提示标题" content="标签一的内容" placement="top" transfer :options="options">
  12 + <Poptip title="提示标题" content="标签一的内容" placement="top" transfer>
13 13 <Button id="aaa">上边</Button>
14 14 </Poptip>
15   - <Poptip title="提示标题" content="标签一的内容" placement="bottom" transfer :options="options">
  15 + <Poptip title="提示标题" content="标签一的内容" placement="bottom" transfer>
16 16 <Button id="aaa">下边</Button>
17 17 </Poptip>
18 18 </div>
... ... @@ -26,11 +26,7 @@
26 26 data () {
27 27 return {
28 28 options: {
29   - modifiers: {
30   - preventOverflow: {
31   - boundariesElement: 'body',
32   - }
33   - }
  29 +
34 30 }
35 31 }
36 32 }
... ...
src/components/base/popper.js
... ... @@ -32,13 +32,10 @@ export default {
32 32 modifiers: {
33 33 computeStyle:{
34 34 gpuAcceleration: false,
  35 + },
  36 + preventOverflow :{
  37 + boundariesElement: 'body'
35 38 }
36   - },
37   - preventOverflow :{
38   - boundariesElement: 'body',
39   - },
40   - flip :{
41   - boundariesElement: 'body',
42 39 }
43 40 };
44 41 }
... ... @@ -89,10 +86,7 @@ export default {
89 86 }
90 87  
91 88 options.placement = this.placement;
92   -
93   - if (!options.modifiers) {
94   - options.modifiers = {};
95   - }
  89 +
96 90 if (!options.modifiers.offset) {
97 91 options.modifiers.offset = {};
98 92 }
... ...