<script setup>
import { computed, ref } from 'vue'

const props = defineProps({
  compData:{}
})

const id = computed(() => {
    if(props.compData.content){
        let params = GetQueryString(props.compData.content)
        return `iframe${params.code}`
    }
    return ''
})

function GetQueryString(url) {
    let urlStr=url.split('?')[1]
    let obj={}
    let paramsArr=urlStr.split('&')
    for (let index = 0; index < paramsArr.length; index++) {
        let arr=paramsArr[index].split('=')
        obj[arr[0]]=arr[1]
    }
    return obj
}
</script>
<template>
  <div 
      class="report-comp-item sheet-comp"
      style="width:100%;overflow: hidden;"
  >
      <div 
          style="padding-left:10px;font-size:17px"
          v-html="compData.titleText"
          v-if="compData.titleText"
      ></div>
      <iframe :class="id" :src="compData.content" width="100%" style="border-width:0px;"></iframe>
  </div>
</template>
<style scoped lang="scss">

</style>