<template>
  <div class="main-link-content" style="height:100%;">
    <iframe
      ref="mainFrame"
      style="border:none"
      width="100%"
      :height="iframeHeight"
      frameborder="0"
      allowtransparency="true" 
      noresize="noresize"
      :src="openParams.actionContent"
    ></iframe>
  </div>
</template>
<script>

export default {
  name: "common_linkcontent",
  props: ['openParams'],
  watch: {    
  },
  created() {    
  },
  mounted() {
     let clientHeight=document.querySelector('.el-dialog-div')&&document.querySelector('.el-dialog-div').offsetHeight
     this.iframeHeight=clientHeight || '100%'
     window.addEventListener('message', this.handleChildMessage);
  },
  data() {
    return{
      iframeHeight:'600'//默认600高度
    }
  },
  methods: {
    handleChildMessage(event) {
      console.log('收到关闭指令和数据:', event.data);
      // this.returnData = event.data.payload;
    }
  }
};
</script>
<style lang="scss" scoped>

</style>


