mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
refactor(components): blankLayout引入GlobalContent
This commit is contained in:
34
src/layouts/common/GlobalContent/index.vue
Normal file
34
src/layouts/common/GlobalContent/index.vue
Normal file
@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<div
|
||||
class="flex-1 flex-col-stretch bg-[#f6f9f8] dark:bg-deep-dark transition-all duration-300 ease-in-out"
|
||||
:class="{ 'overflow-hidden': routeProps.fullPage, 'p-16px': showPadding }"
|
||||
>
|
||||
<router-view v-slot="{ Component, route }">
|
||||
<transition :name="theme.pageAnimateType" mode="out-in" appear>
|
||||
<keep-alive :include="cacheRoutes">
|
||||
<component :is="Component" v-if="app.reloadFlag" :key="route.fullPath" class="flex-1" />
|
||||
</keep-alive>
|
||||
</transition>
|
||||
</router-view>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { cacheRoutes } from '@/router';
|
||||
import { useAppStore, useThemeStore } from '@/store';
|
||||
import { useRouteProps } from '@/composables';
|
||||
|
||||
interface Props {
|
||||
/** 显示padding */
|
||||
showPadding?: boolean;
|
||||
}
|
||||
|
||||
withDefaults(defineProps<Props>(), {
|
||||
showPadding: true
|
||||
});
|
||||
|
||||
const theme = useThemeStore();
|
||||
const app = useAppStore();
|
||||
const routeProps = useRouteProps();
|
||||
</script>
|
||||
<style scoped></style>
|
Reference in New Issue
Block a user