feat : 修改菜单状态

This commit is contained in:
clay
2024-05-23 14:49:56 +08:00
parent 21f90e438c
commit e9e5a0c785
9 changed files with 36 additions and 21 deletions

View File

@@ -1,7 +1,7 @@
<template>
<!-- 有子菜单 -->
<template v-for="item in menuItem" :key="item.path">
<el-sub-menu v-if="item?.children?.length>0 && !item.hidden" :index="item.path">
<el-sub-menu v-if="checkMenuItem(item)" :index="item.path">
<template #title>
<svg-icon :name="item.icon"/>
<span>{{ item.title }}</span>
@@ -44,5 +44,19 @@ const handleGo = (path) => {
}
}
const checkMenuItem = (item) => {
let children = item.children
let childState = false;
if (children){
for (let child of children) {
if (!child.hidden) {
childState = true
break
}
}
}
return item?.children?.length>0 && !item.hidden && childState
}
</script>

View File

@@ -1,6 +1,7 @@
<template>
<div class="logo" ref="logo">
<span v-if="!siderbarStore.isCollapse">科研管理平台</span>
<!-- <span v-if="!siderbarStore.isCollapse">科研管理平台</span>-->
<span v-if="!siderbarStore.isCollapse"></span>
</div>
<el-scrollbar :height="`calc(100vh - ${logoHeight}px)`" style="background-color: #ffffff">
<el-menu