From a1d7e81859f554f3a53680cc35f0f49bf1f77098 Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期四, 14 五月 2026 14:37:02 +0800
Subject: [PATCH] 导入项目
---
src/components/IFrame/src/IFrame.vue | 47 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 47 insertions(+), 0 deletions(-)
diff --git a/src/components/IFrame/src/IFrame.vue b/src/components/IFrame/src/IFrame.vue
new file mode 100644
index 0000000..64ffc0e
--- /dev/null
+++ b/src/components/IFrame/src/IFrame.vue
@@ -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>
--
Gitblit v1.8.0