Ben Lin
2024-08-01 d972fbb5bb3a82fff82d965a29041461c090e715
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<template>
  <div v-if="showFrame">
    <template v-for="frame in getFramePages" :key="frame.path">
      <FramePage
        v-if="frame.meta.frameSrc && hasRenderFrame(frame.name)"
        v-show="showIframe(frame)"
        :frameSrc="frame.meta.frameSrc"
      />
    </template>
  </div>
</template>
<script lang="ts" setup>
  import { unref, computed } from 'vue';
  import FramePage from '@/views/sys/iframe/index.vue';
 
  import { useFrameKeepAlive } from './useFrameKeepAlive';
 
  defineOptions({ name: 'FrameLayout' });
 
  const { getFramePages, hasRenderFrame, showIframe } = useFrameKeepAlive();
 
  const showFrame = computed(() => unref(getFramePages).length > 0);
</script>