<!-- iframe页 -->
<template>
    <div class="iframe-view-box">
        <iframe class="iframe-view" :src="state.url" v-if="state.url && state.url !== 'undefined'" />
        <div v-else style="padding: 0.8em">Iframe 视图请提供 url 参数</div>
    </div>
</template>

<script setup name="iframe-view">
import {useRoute} from "vue-router";
import {reactive} from "vue";
const route = useRoute();

// 解析 url 参数
const state = reactive({
    url: route.meta.iframeUrl || decodeURIComponent(route.query.url)
})

</script>

<style scoped>
.iframe-view-box,.iframe-view{
    width: 100%;
    height: calc(100vh - 84px);
}
.iframe-view{border: 0px;}
</style>
