Closed hyzx86 closed 2 years ago
参考umi 文档操作 https://umijs.org/zh-CN/docs/runtime-config#patchroutes-routes- 修改路由无效,菜单能出来,但打开页面显示404
Please provide a repository using yarn create @umijs/umi-app then upload to your GitHub 请提供一个可复现的仓库,使用 yarn create @umijs/umi-app 创建,并上传到你的 GitHub 仓库 测试代码如下
yarn create @umijs/umi-app
export function patchRoutes({ routes }) { routes[0].routes[7].routes.push({ name: 'amisEditor111', path: '/editor111', locale: false, meta: { schemaId: '40emtqq91aqe855bydkj268gx6' }, component: dynamic({ loader: () => import(‘./pages/develop/dynamicPage'), loading: LoadingComponent, }), }); console.log(routes, 'patchRoutespatchRoutes'); return routes; }
Steps to reproduce the behavior: 1. 2.
Expected behavior 1. 2.
如下截图,组件找到了,但依旧显示404
相同的问题 在 antdpro
https://github.com/ant-design/ant-design-pro/issues/9920
刷下页面
没用,据说是不支持动态创建路由,可以创建好规则然后 在规则下使用参数化路由
先凑合用了。。
What happens?
参考umi 文档操作 https://umijs.org/zh-CN/docs/runtime-config#patchroutes-routes- 修改路由无效,菜单能出来,但打开页面显示404
Mini Showcase Repository(REQUIRED)
How To Reproduce
Steps to reproduce the behavior: 1. 2.
Expected behavior 1. 2.
如下截图,组件找到了,但依旧显示404
Context