懒羊羊
2024-01-31 e57a8990ae56f657a59c435a0613c5f7a8728003
提交 | 用户 | 时间
e57a89 1 <template>
2   <div v-loading="loading" :style="'height:' + height">
3     <iframe
4       :src="src"
5       frameborder="no"
6       style="width: 100%; height: 100%"
7       scrolling="auto"
8     />
9   </div>
10 </template>
11 <script>
12 export default {
13   props: {
14     src: {
15       type: String,
16       required: true
17     },
18   },
19   data() {
20     return {
21       height: document.documentElement.clientHeight - 94.5 + "px;",
22       loading: true,
23       url: this.src
24     };
25   },
26   mounted: function () {
27     setTimeout(() => {
28       this.loading = false;
29     }, 300);
30     const that = this;
31     window.onresize = function temp() {
32       that.height = document.documentElement.clientHeight - 94.5 + "px;";
33     };
34   }
35 };
36 </script>