feat: Implement News Info management features including CRUD operations and rich text editor
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled
This commit is contained in:
@@ -6,6 +6,11 @@ import React, { lazy } from 'react';
|
||||
|
||||
let remoteMenu: any = null;
|
||||
|
||||
// Remote CMS menus are returned by the backend at runtime. Keep newly added
|
||||
// pages with an explicit import so production webpack builds cannot tree-shake
|
||||
// them out of the dynamic import context before the remote menu is available.
|
||||
const newsInfoRemoteComponent = lazy(() => import('@/pages/NewsInfo/index'));
|
||||
|
||||
export function getRemoteMenu() {
|
||||
return remoteMenu;
|
||||
}
|
||||
@@ -60,7 +65,11 @@ function patchRouteItems(route: any, menu: any, parentPath: string) {
|
||||
route.children = [];
|
||||
}
|
||||
const newRoute = {
|
||||
element: React.createElement(lazy(() => import('@/pages/' + path))),
|
||||
element: React.createElement(
|
||||
path === 'NewsInfo/index.tsx'
|
||||
? newsInfoRemoteComponent
|
||||
: lazy(() => import('@/pages/' + path)),
|
||||
),
|
||||
path: parentPath + menuItem.path,
|
||||
}
|
||||
route.children.push(newRoute);
|
||||
|
||||
Reference in New Issue
Block a user