From 49f8eeef1dfbc4ba1eb3a4cc413e4a78eba0357c Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期六, 07 二月 2026 09:47:54 +0800
Subject: [PATCH] #取消页面缓存和更新页面组件
---
rsf-admin/src/layout/index.jsx | 25 +++++++++++++------------
1 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/rsf-admin/src/layout/index.jsx b/rsf-admin/src/layout/index.jsx
index faec8e1..95e8f93 100644
--- a/rsf-admin/src/layout/index.jsx
+++ b/rsf-admin/src/layout/index.jsx
@@ -1,9 +1,7 @@
import { Layout as RALayout, CheckForApplicationUpdate, useSidebarState } from "react-admin";
-import { AliveScope } from 'react-activation';
import AppBar from './AppBar';
import { MyMenu } from './MyMenu';
import TabsBar from './TabsBar';
-import KeepAliveWrapper from './KeepAliveWrapper';
import { Box } from '@mui/material';
const LayoutContent = ({ children }) => {
@@ -22,32 +20,35 @@
width: `calc(100% - ${sidebarWidth}px)`,
height: 'calc(100% - 86px)', // 鍑忓幓TabsBar鐨勯珮搴� (50px AppBar + 36px TabsBar)
top: '86px',
- // 浼樺寲杩囨浮鍔ㄧ敾锛氱缉鐭椂闂达紝浣跨敤鏇村钩婊戠殑 easing
- transition: 'left 150ms ease-out, width 150ms ease-out',
- willChange: 'left, width', // GPU 鍔犻��
+ transition: (theme) =>
+ theme.transitions.create(['left', 'width'], {
+ easing: theme.transitions.easing.sharp,
+ duration: theme.transitions.duration.leavingScreen,
+ }),
}
}}
>
<Box sx={{
position: 'fixed',
top: 48,
+ // left: 0,
left: sidebarWidth + 5,
right: 0,
zIndex: 1100,
- // 浼樺寲杩囨浮鍔ㄧ敾
- transition: 'left 150ms ease-out',
- willChange: 'left', // GPU 鍔犻��
+ transition: (theme) =>
+ theme.transitions.create('left', {
+ easing: theme.transitions.easing.sharp,
+ duration: theme.transitions.duration.leavingScreen,
+ }),
}}>
<TabsBar />
</Box>
- <KeepAliveWrapper>{children}</KeepAliveWrapper>
+ {children}
<CheckForApplicationUpdate />
</RALayout>
);
};
export const Layout = ({ children }) => (
- <AliveScope max={10}>
- <LayoutContent>{children}</LayoutContent>
- </AliveScope>
+ <LayoutContent>{children}</LayoutContent>
);
--
Gitblit v1.9.1