运行时配置
【需求】history页面的菜单,是根据device页面的数据动态渲染的
/**
- 运行时配置
- @see https://umijs.org/docs/api/runtime-config
*/
// let url: any = null;
// export function patchClientRoutes({ routes = url }: any) {
// if (getStorage(‘history’)) {
// if (configroutes?.[2]?.routes?.[1]?.routes) {
// configroutes[2].routes[1].routes = [];
// configroutes[2].routes[1].children = [];
// }
// getStorage(‘history’).map((t: any) => {
// configroutes?.[2]?.routes?.[1]?.routes?.push({
// title: t?.label,
// path: ‘/pst/history/’ + t?.key,
// component: ,
// });
// configroutes?.[2]?.routes?.[1]?.children?.push({
// title: t?.label,
// path: ‘/pst/history/’ + t?.key,
// children: null,
// });
// routes?.[2].children.push({
// path: ‘/pst/history/’ + t?.key,
// element: ,
// title: t?.label,
// });
// });
// }
// url = routes;
// }
// export function render(oldRender: () => void) {
// oldRender();
// }
在其他页面中使用:patchClientRoutes({ routes: undefined }); location.replace(‘/pst/device’);
895

被折叠的 条评论
为什么被折叠?



