1
0
forked from ruoyi/RuoYi-Vue3

优化页面内嵌iframe切换tab不刷新数据

This commit is contained in:
RuoYi
2022-08-23 20:47:41 +08:00
parent 2952cb2c4f
commit 439b134c9b
6 changed files with 101 additions and 35 deletions

View File

@@ -2,23 +2,20 @@
<section class="app-main">
<router-view v-slot="{ Component, route }">
<transition name="fade-transform" mode="out-in">
<keep-alive :include="cachedViews">
<component :is="Component" :key="route.path"/>
<keep-alive :include="tagsViewStore.cachedViews">
<component v-if="!route.meta.link" :is="Component" :key="route.path"/>
</keep-alive>
</transition>
</router-view>
<iframe-toggle />
</section>
</template>
<script setup>
import iframeToggle from "./IframeToggle/index"
import useTagsViewStore from '@/store/modules/tagsView'
const tagsViewStore = useTagsViewStore()
const route = useRoute()
tagsViewStore.addCachedView(route)
const cachedViews = computed(() => {
return tagsViewStore.cachedViews
})
</script>
<style lang="scss" scoped>