38 lines
900 B
Vue
Raw Normal View History

2024-06-29 17:11:31 +08:00
<template>
<FillPage>
<div v-if="!isLoading" class="loading-page">
<div class="dc-loader"></div>
</div>
<iframe v-show="isLoading" :src="link" class="iframe-size" id="internalLinkPage"> </iframe>
2024-06-29 17:11:31 +08:00
</FillPage>
</template>
<script setup lang="ts">
import { useRoute } from "vue-router";
const route = useRoute();
const link = ref<string>(route.meta.link as string);
const isLoading = ref(false); // iframe是否加载完成
onMounted(() => {
let iframe = document.getElementById("internalLinkPage") as HTMLElement;
if (iframe) {
// 加载完成
iframe.onload = () => {
isLoading.value = true;
};
}
});
2024-06-29 17:11:31 +08:00
</script>
<style lang="scss" scoped>
.iframe-size {
width: 100%;
height: 100%;
border: 0;
box-sizing: border-box;
position: absolute; // 设置绝对定位,解决边框滚动条显示问题
}
</style>