fix: 🐛 修复菜单搜索时,地址不对的bug
修复菜单搜索时,地址不对的bug
This commit is contained in:
@@ -290,7 +290,9 @@ function navigateToRoute(item: SearchItem) {
|
|||||||
|
|
||||||
function loadRoutes(routes: RouteRecordRaw[], parentPath = "") {
|
function loadRoutes(routes: RouteRecordRaw[], parentPath = "") {
|
||||||
routes.forEach((route) => {
|
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 (excludedRoutes.value.includes(route.path) || isExternal(route.path)) return;
|
||||||
|
|
||||||
if (route.children) {
|
if (route.children) {
|
||||||
|
|||||||
Reference in New Issue
Block a user