修复issue#126 (#131)

* 修复issue#126

修复issue#126中的顶部菜单栏未选中的样式问题

* Update Header.vue

* Update Header.vue
This commit is contained in:
Kerwin Bryant 2022-04-26 10:55:04 +08:00 committed by GitHub
parent 9c03616909
commit 33bdd29561
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -116,13 +116,14 @@ const toggleSettingPanel = () => {
}; };
const active = computed(() => { const active = computed(() => {
const { layout } = props;
const route = useRoute(); const route = useRoute();
if (!route.path) { if (!route.path) {
return ''; return '';
} }
return route.path return route.path
.split('/') .split('/')
.filter((item, index) => index <= props.maxLevel && index > 0) .filter((item, index) => index < props.maxLevel - (layout === 'mix' ? 1 : -1) && index > 0)
.map((item) => `/${item}`) .map((item) => `/${item}`)
.join(''); .join('');
}); });