27 lines
672 B
Vue
Raw Normal View History

2023-04-03 00:26:04 +08:00
<template>
<div v-loading="loading" :style="'height:' + height">
<iframe :src="url" frameborder="no" style="width: 100%; height: 100%" scrolling="auto" />
</div>
</template>
2023-04-02 01:01:56 +08:00
<script setup lang="ts">
import { propTypes } from '@/utils/propTypes';
2023-03-15 15:59:21 +08:00
const props = defineProps({
src: propTypes.string.isRequired
});
2023-03-15 15:59:21 +08:00
const height = ref(document.documentElement.clientHeight - 94.5 + 'px;');
const loading = ref(true);
const url = computed(() => props.src);
2023-03-15 15:59:21 +08:00
onMounted(() => {
setTimeout(() => {
loading.value = false;
}, 300);
window.onresize = function temp() {
height.value = document.documentElement.clientHeight - 94.5 + 'px;';
2023-03-15 15:59:21 +08:00
};
});
2023-03-15 15:59:21 +08:00
</script>