mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-29 02:15:07 +08:00
feat: add vue3(element-plus)
This commit is contained in:
3
yudao-ui-admin-vue3/src/components/IFrame/index.ts
Normal file
3
yudao-ui-admin-vue3/src/components/IFrame/index.ts
Normal file
@ -0,0 +1,3 @@
|
||||
import IFrame from './src/IFrame.vue'
|
||||
|
||||
export { IFrame }
|
33
yudao-ui-admin-vue3/src/components/IFrame/src/IFrame.vue
Normal file
33
yudao-ui-admin-vue3/src/components/IFrame/src/IFrame.vue
Normal file
@ -0,0 +1,33 @@
|
||||
<script setup lang="ts">
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
import { ref, onMounted } from 'vue'
|
||||
const props = defineProps({
|
||||
src: propTypes.string.def('')
|
||||
})
|
||||
const loading = ref(true)
|
||||
const frameSrc = ref<string>('')
|
||||
const height = ref('')
|
||||
const frameRef = ref<HTMLElement | null>(null)
|
||||
const init = () => {
|
||||
frameSrc.value = props.src
|
||||
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="frameSrc"
|
||||
style="width: 100%; height: 100%"
|
||||
frameborder="no"
|
||||
scrolling="auto"
|
||||
ref="frameRef"
|
||||
></iframe>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="less" scoped></script>
|
Reference in New Issue
Block a user