-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
vue3下不同父级菜单,相同path和组件地址,其中一个报404 #1926
Unanswered
bkywksj
asked this question in
Help and Questions
-
Reproduction
见下
Steps to reproduce the bug
路由页面写法:
<router-view v-slot="{ Component, route }"> <transition name="fade-transform" mode="out-in"> <keep-alive :include="tagsViewStore.cachedViews"> <component v-if="!route.meta.link" :is="Component" :key="route.path"/> </keep-alive> </transition> </router-view>
vue3下菜单配置如下:
[ { "name": "Tool", "path": "/tool", "hidden": false, "redirect": "noRedirect", "component": "Layout", "alwaysShow": true, "meta": { "title": "系统工具", "icon": "tool", "noCache": false, "link": null }, "children": [ { "name": "Demo", "path": "demo", "hidden": false, "component": "demo/demo/index", "meta": { "title": "demo", "icon": "404", "noCache": false, "link": null } } ] }, { "name": "Demo", "path": "/demo", "hidden": false, "redirect": "noRedirect", "component": "Layout", "alwaysShow": true, "meta": { "title": "测试菜单", "icon": "star", "noCache": false, "link": null }, "children": [ { "name": "Demo", "path": "demo", "hidden": false, "component": "demo/demo/index", "meta": { "title": "测试单表", "icon": "#", "noCache": false, "link": null } } ] } ]
观察上方菜单demo,二者path一样都是demo,完整路径分别是/tool/demo和/demo/demo,都是指向相同的组件,但是第一个报404,第二个正常。。这样的设置在vue2下正常(vue-router 3.x版本)
希望看下vue3下不正常是什么原因导致的
带图解释地址:https://gitee.com/dromara/RuoYi-Vue-Plus/issues/I7KA2C
Expected behavior
希望vue3下就算path部分相同也能路由到正确的组件。他们虽然子菜单path相同,但是经过拼接过,path是不一样的
Actual behavior
404
Additional information
No response
Beta Was this translation helpful? Give feedback.
All reactions
-
😕 1
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment