Commit 86b3ba85b48272229c07fbfafc8bfb1c38f2a4a8

Authored by Aresn
Committed by GitHub
2 parents b0794170 f0116c03

Merge pull request #3412 from huanghong1125/poptip

update poptip content change
examples/routers/poptip.vue
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
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="width: 200px;height:300px;overflow: auto;"> 5 + <!-- <div style="width: 200px;height:300px;overflow: auto;">
6 <Poptip title="提示标题" content="标签一的内容" placement="left" transfer > 6 <Poptip title="提示标题" content="标签一的内容" placement="left" transfer >
7 <Button id="aaa">左边</Button> 7 <Button id="aaa">左边</Button>
8 </Poptip> 8 </Poptip>
@@ -15,6 +15,19 @@ @@ -15,6 +15,19 @@
15 <Poptip title="提示标题" content="标签一的内容" placement="bottom" transfer> 15 <Poptip title="提示标题" content="标签一的内容" placement="bottom" transfer>
16 <Button id="aaa">下边</Button> 16 <Button id="aaa">下边</Button>
17 </Poptip> 17 </Poptip>
  18 + </div> -->
  19 + <div>
  20 + <Poptip title="提示标题" content="标签一的内容" transfer>
  21 + <Button id="aaa">点击显示</Button>
  22 + <div slot="content">
  23 + <Button @click='loadData(15)'>15条数据</Button>
  24 + <Button @click='loadData(10)'>10条数据</Button>
  25 + <Button @click='loadData(5)'>5条数据</Button>
  26 + <Button @click='loadData(3)'>3条数据</Button>
  27 + <Table :columns='columns1' :data='data1'>
  28 + </Table>
  29 + </div>
  30 + </Poptip>
18 </div> 31 </div>
19 </TabPane> 32 </TabPane>
20 <TabPane label="标签二" name="name2">标签二的内容</TabPane> 33 <TabPane label="标签二" name="name2">标签二的内容</TabPane>
@@ -27,8 +40,48 @@ @@ -27,8 +40,48 @@
27 return { 40 return {
28 options: { 41 options: {
29 42
30 - } 43 + },
  44 + columns1:[
  45 + {
  46 + title: 'Data1',
  47 + key: 'data1',
  48 + width: 100,
  49 + },
  50 + {
  51 + title: 'Data2',
  52 + key: 'data2',
  53 + width: 100
  54 + },
  55 + {
  56 + title: 'Data3',
  57 + key: 'data3',
  58 + width: 100
  59 + },
  60 + {
  61 + title: 'Data4',
  62 + key: 'data4',
  63 + width: 100
  64 + }
  65 + ],
  66 + data1:[],
31 } 67 }
  68 + },
  69 + created(){
  70 + this.loadData(5);
  71 + },
  72 + methods:{
  73 + loadData(num){
  74 + let data = [];
  75 + for (let i=0; i<num; i++) {
  76 + data.push({
  77 + data1:Math.random()*1000000,
  78 + data2:Math.random()*100000000,
  79 + data3:Math.random()*10000000000,
  80 + data4:Math.random()*1000000000000,
  81 + })
  82 + }
  83 + this.data1 = data
  84 + },
32 } 85 }
33 } 86 }
34 </script> 87 </script>
src/components/base/popper.js
@@ -110,6 +110,10 @@ export default { @@ -110,6 +110,10 @@ export default {
110 this.popperJS = null; 110 this.popperJS = null;
111 } 111 }
112 }, 112 },
  113 + updated (){
  114 + this.$nextTick(()=>this.updatePopper());
  115 +
  116 + },
113 beforeDestroy() { 117 beforeDestroy() {
114 if (isServer) return; 118 if (isServer) return;
115 if (this.popperJS) { 119 if (this.popperJS) {