【新增】前端代码第一次提交

This commit is contained in:
YOHO\20373
2025-04-17 16:42:02 +08:00
parent e0f13c705b
commit 865ebd0a4d
1635 changed files with 237638 additions and 23 deletions

View File

@@ -0,0 +1,3 @@
import IFrame from './src/IFrame.vue'
export { IFrame }

View File

@@ -0,0 +1,47 @@
<script lang="ts" setup>
import { propTypes } from '@/utils/propTypes'
defineOptions({ name: 'IFrame' })
const props = defineProps({
src: propTypes.string.def('')
})
const loading = ref(true)
const frameRef = ref<HTMLElement | null>(null)
const init = () => {
nextTick(() => {
loading.value = true
if (!frameRef.value) return
frameRef.value.onload = () => {
loading.value = false
}
})
}
onMounted(() => {
init()
})
watch(
() => props.src,
() => {
init()
}
)
</script>
<template>
<div
v-loading="loading"
class="w-full h-[calc(100vh-var(--top-tool-height)-var(--tags-view-height)-var(--app-content-padding)-var(--app-content-padding)-2px)]"
>
<iframe
ref="frameRef"
:src="props.src"
frameborder="0"
scrolling="auto"
height="100%"
width="100%"
allowfullscreen="true"
webkitallowfullscreen="true"
mozallowfullscreen="true"
></iframe>
</div>
</template>