<template>
    <iframe :src="iframeSrc" :height="height" width="100%" class="iframe"> </iframe>
</template>
<script>
import { mapState } from 'vuex'

export default {
    created() {
        this.getIframeSrc();
    },
    data() {
        return {
            iframeSrc: '/404',
        }
    },
    computed: {
        height() {
            return window.innerHeight - 104 + 'px'
        }
    },
    methods: {
        getIframeSrc() {

            console.log(decodeURIComponent(window.location.href.split('?code=')[1]));
            this.iframeSrc = decodeURIComponent(window.location.href.split('?code=')[1]);

        },
    },
    watch: {
        $route() {
            this.getIframeSrc()
        }
    },

}
</script>
<style lang="less" scoped>
.iframe {
    border: none;
}
</style>
