<template>
    <iframe style="width:100%;height: 100%" :src="url" frameborder="0"></iframe>
</template>
<style lang="scss" scoped>

</style>
<script lang="ts">
import { getliveinfo } from '@/api';
import store from '@/store';
import { defineComponent, ref } from 'vue';
import { useRoute } from 'vue-router';


export default defineComponent({
    setup(){
        const id = useRoute().query.id;
        const url = ref<string>()
        if(id && typeof id == 'string'){
            getliveinfo(parseInt(id)).then((res: any)=>{
                url.value = `/zhibo.html?roomid=${res.roomid}&memberid=${res.memberid}&name=${escape(store.state.userinfo.name)}`
            })

        }

        return {
            url
        }
    }
})

</script>