<template>
    <div 
        class="report-comp-item sheet-comp"
        style="width:100%;overflow: hidden;margin-bottom:10px"
    >
        <iframe :class="id" :src="compData.content" width="100%" style="border-width:0px;"></iframe>
    </div>
</template>

<script>
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
}
export default {
    props:{
        compData:{}
    },
    computed: {
        id(){
            if(this.compData.content){
                // console.log(this.compData.content);
                let params = GetQueryString(this.compData.content)
                // console.log(params);
                return `iframe${params.code}`
            }
            return ''
        }
    },
}
</script>

<style>

</style>