2022-03-24 04:15:14 +00:00
|
|
|
<template>
|
2022-11-13 16:38:28 +00:00
|
|
|
<div class="app-main" >
|
2022-11-03 04:57:30 +00:00
|
|
|
<div class="app-main-inner">
|
|
|
|
|
<router-view v-slot="{ Component, route }">
|
|
|
|
|
<transition name="fade-slide" mode="out-in" appear>
|
2022-11-13 16:38:28 +00:00
|
|
|
<keep-alive :include="cacheRoutes" v-if="isReload">
|
2022-11-03 04:57:30 +00:00
|
|
|
<component :is="Component" :key="route.path" />
|
|
|
|
|
</keep-alive>
|
|
|
|
|
</transition>
|
|
|
|
|
</router-view>
|
|
|
|
|
</div>
|
2022-09-29 14:04:17 +00:00
|
|
|
<Theme />
|
2022-11-20 11:53:13 +00:00
|
|
|
|
2022-09-12 12:31:21 +00:00
|
|
|
</div>
|
2022-03-24 04:15:14 +00:00
|
|
|
</template>
|
|
|
|
|
|
2022-04-30 13:19:10 +00:00
|
|
|
<script lang="ts" setup>
|
2022-09-29 14:04:17 +00:00
|
|
|
import Theme from '@/components/Theme/index.vue'
|
2022-11-20 11:53:13 +00:00
|
|
|
|
2022-08-05 08:04:07 +00:00
|
|
|
import { computed, ref } from 'vue'
|
2022-08-31 03:01:44 +00:00
|
|
|
import {useSettingStore} from "@/store/modules/setting"
|
2022-09-28 09:08:12 +00:00
|
|
|
import {usePermissionStore} from "@/store/modules/permission"
|
2022-08-31 03:01:44 +00:00
|
|
|
const SettingStore = useSettingStore()
|
2022-11-11 15:58:05 +00:00
|
|
|
const PermissionStore = usePermissionStore()
|
2022-04-30 13:19:10 +00:00
|
|
|
|
2022-11-11 15:58:05 +00:00
|
|
|
const cacheRoutes = computed(() =>PermissionStore.getCacheRoutes())
|
2022-08-31 03:01:44 +00:00
|
|
|
const isReload = computed(() => SettingStore.isReload)
|
2022-06-07 09:54:21 +00:00
|
|
|
|
2022-03-24 04:15:14 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2022-08-05 08:04:07 +00:00
|
|
|
.app-main {
|
2022-09-12 12:31:21 +00:00
|
|
|
flex: 1;
|
2022-09-12 16:11:45 +00:00
|
|
|
display: flex;
|
2022-06-16 06:48:48 +00:00
|
|
|
overflow-x: hidden;
|
2022-11-20 11:53:13 +00:00
|
|
|
|
2022-06-16 06:48:48 +00:00
|
|
|
width: 100%;
|
2022-03-31 02:13:27 +00:00
|
|
|
box-sizing: border-box;
|
2022-11-03 04:57:30 +00:00
|
|
|
.app-main-inner{
|
|
|
|
|
flex: 1;
|
|
|
|
|
display: flex;
|
|
|
|
|
overflow-x: hidden;
|
|
|
|
|
width: 100%;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
}
|
2022-03-24 04:15:14 +00:00
|
|
|
}
|
|
|
|
|
</style>
|