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,17 +2,17 @@
2 <div style="margin: 200px"> 2 <div style="margin: 200px">
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">  
6 - <Poptip title="提示标题" content="标签一的内容" placement="left" transfer :options="options"> 5 + <div style="width: 200px;height:300px">
  6 + <Poptip title="提示标题" content="标签一的内容" placement="left" transfer >
7 <Button id="aaa">左边</Button> 7 <Button id="aaa">左边</Button>
8 </Poptip> 8 </Poptip>
9 - <Poptip title="提示标题" content="标签一的内容" placement="right" transfer :options="options"> 9 + <Poptip title="提示标题" content="标签一的内容" placement="right" transfer>
10 <Button id="aaa">右边</Button> 10 <Button id="aaa">右边</Button>
11 </Poptip> 11 </Poptip>
12 - <Poptip title="提示标题" content="标签一的内容" placement="top" transfer :options="options"> 12 + <Poptip title="提示标题" content="标签一的内容" placement="top" transfer>
13 <Button id="aaa">上边</Button> 13 <Button id="aaa">上边</Button>
14 </Poptip> 14 </Poptip>
15 - <Poptip title="提示标题" content="标签一的内容" placement="bottom" transfer :options="options"> 15 + <Poptip title="提示标题" content="标签一的内容" placement="bottom" transfer>
16 <Button id="aaa">下边</Button> 16 <Button id="aaa">下边</Button>
17 </Poptip> 17 </Poptip>
18 </div> 18 </div>
@@ -26,11 +26,7 @@ @@ -26,11 +26,7 @@
26 data () { 26 data () {
27 return { 27 return {
28 options: { 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,13 +32,10 @@ export default {
32 modifiers: { 32 modifiers: {
33 computeStyle:{ 33 computeStyle:{
34 gpuAcceleration: false, 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,10 +86,7 @@ export default {
89 } 86 }
90 87
91 options.placement = this.placement; 88 options.placement = this.placement;
92 -  
93 - if (!options.modifiers) {  
94 - options.modifiers = {};  
95 - } 89 +
96 if (!options.modifiers.offset) { 90 if (!options.modifiers.offset) {
97 options.modifiers.offset = {}; 91 options.modifiers.offset = {};
98 } 92 }