Skip to content

Commit

Permalink
revert: fix顶部菜单高亮 (#601)
Browse files Browse the repository at this point in the history
  • Loading branch information
liweijie0812 authored Sep 14, 2023
1 parent d775bc3 commit 9c3fbdd
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/router/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import uniq from 'lodash/uniq';
import { createRouter, createWebHistory, RouteRecordRaw, useRoute } from 'vue-router';

import { useSettingStore } from '@/store';

const env = import.meta.env.MODE || 'development';

// 导入homepage相关固定路由
Expand Down Expand Up @@ -62,16 +60,11 @@ export const getRoutesExpanded = () => {

export const getActive = (maxLevel = 3): string => {
const route = useRoute();
const settingStore = useSettingStore();

if (!route.path) {
return '';
}

if (settingStore.layout === 'top') {
return route.path.split('/').slice(0, 2).join('/');
}

return route.path
.split('/')
.filter((_item: string, index: number) => index <= maxLevel && index > 0)
Expand Down

0 comments on commit 9c3fbdd

Please sign in to comment.