zhou zhou
17 小时以前 46d872c1a5b77aa8799de4a64888a0a24a1422d6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<template>
  <div class="box-border w-full h-full" v-loading="isLoading">
    <iframe
      ref="iframeRef"
      :src="iframeUrl"
      frameborder="0"
      class="w-full h-full min-h-[calc(100vh-120px)] border-none"
      @load="handleIframeLoad"
    ></iframe>
  </div>
</template>
 
<script setup>
  import { IframeRouteManager } from '@/router/core'
  defineOptions({ name: 'IframeView' })
  const route = useRoute()
  const isLoading = ref(true)
  const iframeUrl = ref('')
  const iframeRef = ref(null)
  onMounted(() => {
    const iframeRoute = IframeRouteManager.getInstance().findByPath(route.path)
    if (iframeRoute?.meta) {
      iframeUrl.value = iframeRoute.meta.link || ''
    }
  })
  const handleIframeLoad = () => {
    isLoading.value = false
  }
</script>