zb-admin/src/layout/Main/index.vue

37 lines
1002 B
Vue
Raw Normal View History

2022-03-24 04:15:14 +00:00
<template>
2022-09-12 12:31:21 +00:00
<div class="app-main" v-if="isReload">
<router-view v-slot="{ Component, route }">
<transition name="fade-slide" mode="out-in" appear>
2022-09-28 09:08:12 +00:00
<keep-alive :include="cacheRoutes">
<component :is="Component" :key="route.path" />
</keep-alive>
</transition>
</router-view>
2022-08-24 10:53:05 +00:00
<u-theme />
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-08-24 10:53:05 +00:00
import UTheme from '@/components/u-theme/index.vue'
import { computed, ref } from 'vue'
import {useSettingStore} from "@/store/modules/setting"
2022-09-28 09:08:12 +00:00
import {usePermissionStore} from "@/store/modules/permission"
const SettingStore = useSettingStore()
2022-09-28 09:08:12 +00:00
const PermissionStor = usePermissionStore()
2022-04-30 13:19:10 +00:00
2022-09-28 09:08:12 +00:00
const cacheRoutes = computed(() =>PermissionStor.cacheRoutes)
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>
.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-09-13 10:34:54 +00:00
flex-direction: column;
2022-06-16 06:48:48 +00:00
width: 100%;
2022-03-31 02:13:27 +00:00
box-sizing: border-box;
2022-03-24 04:15:14 +00:00
}
</style>