<template>
|
<div class="box-border w-full h-full" v-loading="isLoading">
|
<iframe
|
ref="iframeRef"
|
:src="iframeUrl"
|
frameborder="0"
|
class="w-full h-full min-h-[calc(100vh-120px)] border-none"
|
@load="handleIframeLoad"
|
></iframe>
|
</div>
|
</template>
|
|
<script setup>
|
import { IframeRouteManager } from '@/router/core'
|
defineOptions({ name: 'IframeView' })
|
const route = useRoute()
|
const isLoading = ref(true)
|
const iframeUrl = ref('')
|
const iframeRef = ref(null)
|
onMounted(() => {
|
const iframeRoute = IframeRouteManager.getInstance().findByPath(route.path)
|
if (iframeRoute?.meta) {
|
iframeUrl.value = iframeRoute.meta.link || ''
|
}
|
})
|
const handleIframeLoad = () => {
|
isLoading.value = false
|
}
|
</script>
|