Comments (2)
问题大概出在 函数 getAllParentPath(allRouters, v.path) 的实现上
根据自己的编码习惯,既然name一定不能重复,那就用name做一个判断吧
name命名以parentName值开头即可,
export const getAllParentPath = <T = Recordable>(treeData: T[], route: AppRouteRecordRaw) => {
const menuList = findPath(
treeData,
(n) => route.name.startsWith(n.name) && n.path === route.path
) as AppRouteRecordRaw[]
return (menuList || []).map((item) => item.path)
}
from vue-element-plus-admin.
@wxg4net, Excellent!
I met the same issue and just fixed with your advice.
Thank you.
from vue-element-plus-admin.
Related Issues (20)
- 建议修改下鉴权逻辑 HOT 1
- 表格列设置bug
- Layout.vue 和 routerView的关系?
- Form组件setValues 方法建议
- 默认主题为Light,在登录页面切换主题为Dark,登录成功进入系统后会出现页面内容主题不一致问题
- 因为激活菜单的背景色,在操作折叠菜单时,感觉体验不是很好,建议关闭菜单折叠动画
- 能否出一款layout默认为top的布局 HOT 1
- table组件相关文档能否补充完整?像卡片表格这种文档 HOT 1
- mini分支下app的 IsDark 失效 HOT 3
- Mini 分支下点击‘项目配置’会报错 HOT 1
- 使用本地host域名访问时,页面502
- 菜单栏多余的省略时 HOT 1
- Mini分支下Search组件的select组件异常 HOT 2
- 不建议使用5000端口,会和macOS 的 airplay 冲突 HOT 1
- mini分支 使用自带mock 然后登陆404 HOT 1
- 启动报错缺少包 Cannot find module @iconify-json/en HOT 2
- 选择第四种布局后,切换左侧二级菜单,加载过程中二级菜单遮挡不全
- 多级路由:想问问作者getParentLayout()的作用到底是啥,只是看到返回了个name而已
- useSearch 中 getFormData 方法未给到预期值 HOT 1
- 登录页样式优化问题
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-element-plus-admin.