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 <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`
|
const layoutContentClass = css`
|
||||||
@ -212,17 +220,13 @@ const pageContentStyle: React.CSSProperties = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const LayoutContent = () => {
|
export const LayoutContent = () => {
|
||||||
const currentPageUid = useCurrentPageUid();
|
|
||||||
|
|
||||||
/* Use the "nb-subpages-slot-without-header-and-side" class name to locate the position of the subpages */
|
/* Use the "nb-subpages-slot-without-header-and-side" class name to locate the position of the subpages */
|
||||||
return (
|
return (
|
||||||
<CurrentRouteProvider uid={currentPageUid}>
|
<div className={`${layoutContentClass} nb-subpages-slot-without-header-and-side`}>
|
||||||
<div className={`${layoutContentClass} nb-subpages-slot-without-header-and-side`}>
|
<div style={pageContentStyle}>
|
||||||
<div style={pageContentStyle}>
|
<Outlet />
|
||||||
<Outlet />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</CurrentRouteProvider>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -25,7 +25,6 @@ import {
|
|||||||
CurrentTabUidContext,
|
CurrentTabUidContext,
|
||||||
useCurrentSearchParams,
|
useCurrentSearchParams,
|
||||||
useCurrentTabUid,
|
useCurrentTabUid,
|
||||||
useLocationNoUpdate,
|
|
||||||
useNavigateNoUpdate,
|
useNavigateNoUpdate,
|
||||||
useRouterBasename,
|
useRouterBasename,
|
||||||
} from '../../../application/CustomRouterContextProvider';
|
} from '../../../application/CustomRouterContextProvider';
|
||||||
@ -202,7 +201,6 @@ interface PageContentProps {
|
|||||||
const InternalPageContent = (props: PageContentProps) => {
|
const InternalPageContent = (props: PageContentProps) => {
|
||||||
const { loading, disablePageHeader, enablePageTabs, activeKey } = props;
|
const { loading, disablePageHeader, enablePageTabs, activeKey } = props;
|
||||||
const currentRoute = useCurrentRouteData();
|
const currentRoute = useCurrentRouteData();
|
||||||
const location = useLocationNoUpdate();
|
|
||||||
const navigate = useNavigateNoUpdate();
|
const navigate = useNavigateNoUpdate();
|
||||||
|
|
||||||
const children = currentRoute?.children || [];
|
const children = currentRoute?.children || [];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user