mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-03 13:44:47 +08:00
fix: 修复params路由传参模式下,面包屑无法找到父级路径问题
This commit is contained in:
@@ -38,9 +38,14 @@ const getBreadcrumb = (): void => {
|
||||
currentRoute = findRouteByPath(router.currentRoute.value.path, multiTags);
|
||||
}
|
||||
// 当前路由的父级路径组成的数组
|
||||
const parentRoutes = getParentPaths(router.currentRoute.value.path, routes);
|
||||
const parentRoutes = getParentPaths(
|
||||
router.currentRoute.value.name as string,
|
||||
routes,
|
||||
"name"
|
||||
);
|
||||
// 存放组成面包屑的数组
|
||||
let matched = [];
|
||||
|
||||
// 获取每个父级路径对应的路由信息
|
||||
parentRoutes.forEach(path => {
|
||||
if (path !== "/") matched.push(findRouteByPath(path, routes));
|
||||
|
||||
Reference in New Issue
Block a user