使用 defineConfig 配置路由不符合预期 #2166
Unanswered
changhuaixin
asked this question in
Q&A
Replies: 1 comment 1 reply
-
感觉当前的规则是根据顶层路由生成一级导航,导航栏内容默认选择排在第 1 位的页面。 实测使用 order: 1 可以控制页面顺序,在对应的 react 组件里写
这是 by-design 的行为吗 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
在 .dumirc.ts 里通过 defineConfig 定义 3 个路由
routes: [
{
path: '/framescope',
component: '../../../framescope/src/layouts/index',
},
{
path: '/framescope/hotspot',
component: '../../../framescope/src/pages/Hotspots/index',
},
{
path: '/framescope/service',
component: '../../../framescope/src/pages/uploadFile/index',
},
导航栏显示第 1 个路由,符合预期
点击跳转到第 2 条路由,期待跳转到第 1 条
期待跳转到的链接是 http://localhost:8000/framescope
实际是 http://localhost:8000/framescope/hotspot
Beta Was this translation helpful? Give feedback.
All reactions