mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 13:39:24 +08:00
fix: keep alive
This commit is contained in:
parent
bea0a2c524
commit
4fe9a10632
@ -136,7 +136,15 @@ export const AdminDynamicPage = () => {
|
||||
return <AppNotFound />;
|
||||
}
|
||||
|
||||
return <KeepAlive uid={currentPageUid}>{(uid) => <RemoteSchemaComponent uid={uid} />}</KeepAlive>;
|
||||
return (
|
||||
<KeepAlive uid={currentPageUid}>
|
||||
{(uid) => (
|
||||
<CurrentRouteProvider uid={uid}>
|
||||
<RemoteSchemaComponent uid={uid} />
|
||||
</CurrentRouteProvider>
|
||||
)}
|
||||
</KeepAlive>
|
||||
);
|
||||
};
|
||||
|
||||
const layoutContentClass = css`
|
||||
@ -212,17 +220,13 @@ const pageContentStyle: React.CSSProperties = {
|
||||
};
|
||||
|
||||
export const LayoutContent = () => {
|
||||
const currentPageUid = useCurrentPageUid();
|
||||
|
||||
/* Use the "nb-subpages-slot-without-header-and-side" class name to locate the position of the subpages */
|
||||
return (
|
||||
<CurrentRouteProvider uid={currentPageUid}>
|
||||
<div className={`${layoutContentClass} nb-subpages-slot-without-header-and-side`}>
|
||||
<div style={pageContentStyle}>
|
||||
<Outlet />
|
||||
</div>
|
||||
<div className={`${layoutContentClass} nb-subpages-slot-without-header-and-side`}>
|
||||
<div style={pageContentStyle}>
|
||||
<Outlet />
|
||||
</div>
|
||||
</CurrentRouteProvider>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -25,7 +25,6 @@ import {
|
||||
CurrentTabUidContext,
|
||||
useCurrentSearchParams,
|
||||
useCurrentTabUid,
|
||||
useLocationNoUpdate,
|
||||
useNavigateNoUpdate,
|
||||
useRouterBasename,
|
||||
} from '../../../application/CustomRouterContextProvider';
|
||||
@ -202,7 +201,6 @@ interface PageContentProps {
|
||||
const InternalPageContent = (props: PageContentProps) => {
|
||||
const { loading, disablePageHeader, enablePageTabs, activeKey } = props;
|
||||
const currentRoute = useCurrentRouteData();
|
||||
const location = useLocationNoUpdate();
|
||||
const navigate = useNavigateNoUpdate();
|
||||
|
||||
const children = currentRoute?.children || [];
|
||||
|
Loading…
x
Reference in New Issue
Block a user