mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
feat(projects): 添加页面缓存、记录在tab中的缓存页面的滚动条位置
This commit is contained in:
@ -3,16 +3,18 @@
|
||||
:class="{ 'p-16px': showPadding }"
|
||||
class="h-full bg-[#f6f9f8] dark:bg-[#101014] transition duration-300 ease-in-out"
|
||||
>
|
||||
<router-view v-slot="{ Component }">
|
||||
<router-view v-slot="{ Component, route }">
|
||||
<transition name="fade-slide" mode="out-in" appear>
|
||||
<component :is="Component" v-if="app.reloadFlag" />
|
||||
<keep-alive :include="routeStore.cacheRoutes">
|
||||
<component :is="Component" v-if="app.reloadFlag" :key="route.path" />
|
||||
</keep-alive>
|
||||
</transition>
|
||||
</router-view>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useAppStore } from '@/store';
|
||||
import { useAppStore, useRouteStore } from '@/store';
|
||||
|
||||
interface Props {
|
||||
/** 显示padding */
|
||||
@ -24,5 +26,6 @@ withDefaults(defineProps<Props>(), {
|
||||
});
|
||||
|
||||
const app = useAppStore();
|
||||
const routeStore = useRouteStore();
|
||||
</script>
|
||||
<style scoped></style>
|
||||
|
@ -33,13 +33,14 @@ interface Props {
|
||||
|
||||
const props = defineProps<Props>();
|
||||
|
||||
type LayoutConfig = {
|
||||
[key in ThemeLayoutMode]: {
|
||||
type LayoutConfig = Record<
|
||||
ThemeLayoutMode,
|
||||
{
|
||||
placement: FollowerPlacement;
|
||||
menuClass: string;
|
||||
mainClass: string;
|
||||
};
|
||||
};
|
||||
}
|
||||
>;
|
||||
|
||||
const layoutConfig: LayoutConfig = {
|
||||
vertical: {
|
||||
|
Reference in New Issue
Block a user