| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <template>
- <div style="width: 100%;height: 100%;" v-loading="loading">
- <iframe id="frameMain"
- :src="currentSrc"
- frameborder="0"></iframe>
- </div>
- </template>
- <script>
- export default {
- name: "tjbb",
- data() {
- return {
- loading:true,
- currentSrc:'',
- screenHeight: window.innerHeight,
- screenWidth: window.innerWidth,
- }
- },
- mounted(){
- const that = this;
- window.onresize = () => {
- return (() => {
- that.screenHeight = window.innerHeight - 90
- that.screenWidth = window.innerWidth
- })()
- }
- console.log(`当前高度${that.screenHeight},当前宽度${that.screenWidth}`);
- that.currentSrc = `http://slbdc.mwr.gov.cn/JsReport/reportFiles/reportjsp/showReport_hzz.jsp?raq=dc_skqktj.raq&width=${that.screenWidth}&height=${that.screenHeight}`
- },
- activated() {
- let _this = this;
- let iframe = document.getElementById("frameMain");
- iframe.onload = function(){
- _this.loading = false;
- };
- iframe.width = _this.screenWidth;
- iframe.height = _this.screenHeight;
- }
- }
- </script>
- <style scoped>
- </style>
|