2025-01-20 08:09:54 +00:00
|
|
|
<!--
|
|
|
|
* @Description:
|
|
|
|
* @Author: zenghua.wang
|
|
|
|
* @Date: 2023-06-20 14:29:45
|
2025-01-25 02:44:29 +00:00
|
|
|
* @LastEditors: zenghua.wang
|
|
|
|
* @LastEditTime: 2025-01-25 09:28:53
|
2025-01-20 08:09:54 +00:00
|
|
|
-->
|
|
|
|
<template>
|
2025-01-25 02:44:29 +00:00
|
|
|
<router-view v-slot="{ Component, route }">
|
|
|
|
<transition name="fade-slide" mode="out-in" appear>
|
|
|
|
<keep-alive v-if="isReload" :include="cacheRoutes">
|
|
|
|
<component :is="useWrapComponents(Component, route)" :key="route.path" />
|
|
|
|
</keep-alive>
|
|
|
|
</transition>
|
|
|
|
</router-view>
|
2025-01-20 08:09:54 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup name="layout">
|
2025-01-25 02:44:29 +00:00
|
|
|
import { computed } from 'vue';
|
2025-01-20 08:09:54 +00:00
|
|
|
import { useSettingStore } from '@/store/modules/setting';
|
|
|
|
import { usePermissionStore } from '@/store/modules/permission';
|
|
|
|
import { useWrapComponents } from '@/hooks/useWrapComponents';
|
|
|
|
|
|
|
|
const SettingStore = useSettingStore();
|
|
|
|
const PermissionStore = usePermissionStore();
|
|
|
|
const cacheRoutes = computed(() => PermissionStore.keepAliveRoutes);
|
|
|
|
const isReload = computed(() => SettingStore.isReload);
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.layout {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
box-sizing: border-box;
|
|
|
|
}
|
|
|
|
</style>
|