Skip to content

Commit

Permalink
fix: 🧩 修复分栏布局路径匹配bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Halsey committed Dec 28, 2022
1 parent 604b97b commit b06bd12
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/layouts/LayoutColumns/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div class="split-list">
<div
class="split-item"
:class="{ 'split-active': splitActive == item.path || `/${splitActive.split('/')[1]}` == item.path }"
:class="{ 'split-active': splitActive === item.path || `/${splitActive.split('/')[1]}` === item.path }"
v-for="item in menuList"
:key="item.path"
@click="changeSubMenu(item)"
Expand Down Expand Up @@ -76,7 +76,9 @@ watch(
// 当前路由存在 tabs 白名单中 || 当前菜单没有数据直接 return
if (TABS_WHITE_LIST.includes(route.path) || !menuList.value.length) return;
splitActive.value = route.path;
const menuItem = menuList.value.filter((item: Menu.MenuOptions) => route.path.includes(item.path));
const menuItem = menuList.value.filter(
(item: Menu.MenuOptions) => route.path === item.path || `/${route.path.split("/")[1]}` === item.path
);
if (menuItem[0].children?.length) return (subMenu.value = menuItem[0].children);
subMenu.value = [];
},
Expand Down

1 comment on commit b06bd12

@vercel
Copy link

@vercel vercel bot commented on b06bd12 Dec 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.