fix: 🐛 修复菜单搜索时,地址不对的bug

修复菜单搜索时,地址不对的bug
This commit is contained in:
Theo
2025-05-28 17:09:59 +08:00
parent bad9f2cc3a
commit 98e437fc50

View File

@@ -290,7 +290,9 @@ function navigateToRoute(item: SearchItem) {
function loadRoutes(routes: RouteRecordRaw[], parentPath = "") {
routes.forEach((route) => {
const path = route.path.startsWith("/") ? route.path : `${parentPath}/${route.path}`;
const path = route.path.startsWith("/")
? route.path
: `${parentPath}${parentPath.endsWith("/") ? "" : "/"}${route.path}`;
if (excludedRoutes.value.includes(route.path) || isExternal(route.path)) return;
if (route.children) {