You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
679 B
Vue
31 lines
679 B
Vue
<script lang="ts" name="IFrame" setup>
|
|
import { propTypes } from '@/utils/propTypes'
|
|
|
|
const props = defineProps({
|
|
src: propTypes.string.def('')
|
|
})
|
|
const loading = ref(true)
|
|
const height = ref('')
|
|
const frameRef = ref<HTMLElement | null>(null)
|
|
const init = () => {
|
|
height.value = document.documentElement.clientHeight - 94.5 + 'px'
|
|
loading.value = false
|
|
}
|
|
onMounted(() => {
|
|
setTimeout(() => {
|
|
init()
|
|
}, 300)
|
|
})
|
|
</script>
|
|
<template>
|
|
<div v-loading="loading" :style="'height:' + height">
|
|
<iframe
|
|
ref="frameRef"
|
|
:src="props.src"
|
|
frameborder="no"
|
|
scrolling="auto"
|
|
style="width: 100%; height: 100%"
|
|
></iframe>
|
|
</div>
|
|
</template>
|