mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
fix(projects): 修复页面滚动和页面100%视高占比
This commit is contained in:
@ -1,22 +1,26 @@
|
||||
<template>
|
||||
<n-layout-content class="flex-auto p-10px" :class="{ 'bg-[#f5f7f9]': !theme.darkMode }">
|
||||
<div
|
||||
class="flex-1 flex-col-stretch p-10px"
|
||||
:class="{ 'bg-[#f5f7f9]': !theme.darkMode, 'overflow-hidden': routeProps.fullPage }"
|
||||
>
|
||||
<router-view v-slot="{ Component, route }">
|
||||
<transition :name="theme.pageStyle.animateType" mode="out-in" appear>
|
||||
<keep-alive :include="cacheRoutes">
|
||||
<component :is="Component" v-if="reload" :key="route.fullPath" />
|
||||
<component :is="Component" v-if="reload" :key="route.fullPath" class="flex-1" />
|
||||
</keep-alive>
|
||||
</transition>
|
||||
</router-view>
|
||||
</n-layout-content>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { NLayoutContent } from 'naive-ui';
|
||||
import { useThemeStore } from '@/store';
|
||||
import { useReloadInject } from '@/context';
|
||||
import { cacheRoutes } from '@/router';
|
||||
import { useRouteProps } from '@/hooks';
|
||||
|
||||
const theme = useThemeStore();
|
||||
const { reload } = useReloadInject();
|
||||
const routeProps = useRouteProps();
|
||||
</script>
|
||||
<style scoped></style>
|
||||
|
@ -1,10 +1,15 @@
|
||||
<template>
|
||||
<n-scrollbar ref="scrollbar" class="h-full" :x-scrollable="true" :content-class="routeProps.fullPage ? 'h-full' : ''">
|
||||
<div class="inline-block w-full" :class="[routeProps.fullPage ? 'h-full' : 'min-h-100vh']">
|
||||
<div class="inline-block w-full h-full">
|
||||
<router-view v-slot="{ Component, route: itemRoute }">
|
||||
<transition :name="theme.pageStyle.animateType" mode="out-in" appear>
|
||||
<keep-alive :include="cacheRoutes">
|
||||
<component :is="Component" v-if="reload" :key="itemRoute.fullPath" />
|
||||
<component
|
||||
:is="Component"
|
||||
v-if="reload"
|
||||
:key="itemRoute.fullPath"
|
||||
:class="{ 'min-h-100vh': !routeProps.fullPage }"
|
||||
/>
|
||||
</keep-alive>
|
||||
</transition>
|
||||
</router-view>
|
||||
|
Reference in New Issue
Block a user