diff --git a/src/components/IFrame/src/IFrame.vue b/src/components/IFrame/src/IFrame.vue index 19de51a3268eaf99ea10a8d3d11c03154e15009a..64ffc0e57883f4f35495f2c44f4df72d359a6219 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 bc047d766e225b918fcffc54c93e1ef0d9c2bc22..2ac99d2398ec8ef8ae3fd7e5eb046de896ddfe42 100644 --- a/src/views/infra/druid/index.vue +++ b/src/views/infra/druid/index.vue @@ -2,8 +2,8 @@ - - + +