diff --git a/src/components/IFrame/src/IFrame.vue b/src/components/IFrame/src/IFrame.vue index 19de51a3..64ffc0e5 100644 --- a/src/components/IFrame/src/IFrame.vue +++ b/src/components/IFrame/src/IFrame.vue @@ -7,26 +7,41 @@ const props = defineProps({ src: propTypes.string.def('') }) const loading = ref(true) -const height = ref('') const frameRef = ref(null) const init = () => { - height.value = document.documentElement.clientHeight - 94.5 + 'px' - loading.value = false + nextTick(() => { + loading.value = true + if (!frameRef.value) return + frameRef.value.onload = () => { + loading.value = false + } + }) } onMounted(() => { - setTimeout(() => { - init() - }, 300) + init() }) +watch( + () => props.src, + () => { + init() + } +) diff --git a/src/views/infra/druid/index.vue b/src/views/infra/druid/index.vue index bc047d76..2ac99d23 100644 --- a/src/views/infra/druid/index.vue +++ b/src/views/infra/druid/index.vue @@ -2,8 +2,8 @@ - - + +