admin-vben/src/layouts/iframe/index.vue

18 lines
618 B
Vue
Raw Normal View History

2023-03-18 13:10:54 +00:00
<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 name="FrameLayout">
import { unref, computed } from 'vue'
2023-03-18 15:14:57 +00:00
import FramePage from '@/views/base/iframe/index.vue'
2023-03-18 13:10:54 +00:00
import { useFrameKeepAlive } from './useFrameKeepAlive'
const { getFramePages, hasRenderFrame, showIframe } = useFrameKeepAlive()
const showFrame = computed(() => unref(getFramePages).length > 0)
</script>