-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Not planned
Labels
Description
Version
Vben Admin V5
Describe the bug?
这个是我的路由定义, bId是可选值
这个是bId为空时, 路由把params的:bid部分当做静态值, 正常来说应是 /listPreparation
这个是在menu里打印的一些值
希望可以用路由的name来判断当前菜单和标签页的高亮和生成, 用fullPath和path的话, 同一个路由的params和query的值变化时, 都会生成新的标签页, 或者是高亮状态和页面刷新的异常
Reproduction
定义和我一样的路由, 页面用两个按钮调用下面函数就可以复现
push({
name: currentRoute.value.name,
params: {
bId: currentNode.value!.ID, // 两次id不同即可
},
});
### System Info
```shell
/
Relevant log output
Validations
- Read the docsEnsure the code is up to date. (Some issues have been fixed in the latest version)I have searched the existing issues and checked that my issue does not duplicate any existing issues.Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.The provided reproduction is a minimal reproducible example of the bug.To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
Activity
miaowwwww commentedon Jan 21, 2025
哥, 最后有处理方案吗?
cypherchen commentedon Jan 21, 2025
我想到的就是用路由的name来当做菜单和标签页的key值, 不过我看了源码里基本都是用fullPath或者path, 这么改的话改动很大, 暂时没有去尝试, 不知道有没有别的好的方法
miaowwwww commentedon Jan 22, 2025
我找到方法了。
加上这两个参数, 然后 dynamicLevel:1 。
这样可以保证不会新增tab
cypherchen commentedon Feb 5, 2025
我试了下, 这两个参数好像没啥用啊
dingdayu commentedon Feb 8, 2025
@miaowwwww @cypherchen 我在解决其他问题时,也遇到这个问题,我提交了一个PR,一起讨论下。
#5500
github-actions commentedon Apr 10, 2025
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days