关于iframe内嵌网页宽高

2018-03-15  本文已影响89人  最慢的是活着
<template>
  <div class="wendan">
  <iframe :src = "this.wendan" :style="{'width':`${iWidth}px`,'height':`${iHeight}px`}" ></iframe>
  </div>
</template>
<script>

export default {
  name: 'wendan',
  props: ['wendan'],
  data(){
    return {
      iWidth:0,
      iHeight:0
    }
  },
  created(){
    this.iWidth =document.documentElement.clientWidth;

    this.iHeight=document.documentElement.clientHeight;
  },
  methods:{
    getHeight(){

    }
  }

}

</script>
<style lang="less" scoped>

</style>


上一篇下一篇

猜你喜欢

热点阅读