mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-07-15 11:25:07 +08:00
初始化项目,自 v1.7.1 版本开始
This commit is contained in:
3
src/components/IFrame/index.ts
Normal file
3
src/components/IFrame/index.ts
Normal file
@ -0,0 +1,3 @@
|
||||
import IFrame from './src/IFrame.vue'
|
||||
|
||||
export { IFrame }
|
30
src/components/IFrame/src/IFrame.vue
Normal file
30
src/components/IFrame/src/IFrame.vue
Normal file
@ -0,0 +1,30 @@
|
||||
<script setup lang="ts">
|
||||
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
|
||||
:src="props.src"
|
||||
style="width: 100%; height: 100%"
|
||||
frameborder="no"
|
||||
scrolling="auto"
|
||||
ref="frameRef"
|
||||
></iframe>
|
||||
</div>
|
||||
</template>
|
Reference in New Issue
Block a user