mirror of
https://github.com/Tencent/tdesign-vue-next-starter.git
synced 2024-12-22 11:46:36 +08:00
revert: fix顶部菜单高亮 (#601)
This commit is contained in:
parent
d775bc3aa9
commit
9c3fbdd71b
|
@ -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相关固定路由
|
||||
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user