map.vue
874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<template>
<div style="height:auto;">
<iframe
src="/map.html"
frameborder="0"
style="width: 100%; height: 100%"
id="bdIframe"
scrolling="no">
</iframe>
</div>
</template>
<script>
export default {
name: "map",
data(){
return{
bdTokenUrl : 'http://193.112.22.34:8081/WebReport/ReportServer?reportlet=PHBIP_JTXX.cpt&op=view'
}
},
mounted(){
/**
* iframe-宽高自适应显示
*/
const oIframe = document.getElementById('bdIframe');
const deviceWidth = document.documentElement.clientWidth;
const deviceHeight = document.documentElement.clientHeight;
oIframe.style.width = (Number(deviceWidth)-220) + 'px'; //数字是页面布局宽度差值
oIframe.style.height = (Number(deviceHeight)-120) + 'px'; //数字是页面布局高度差
}
}
</script>
<style scoped>
</style>