bug修复
This commit is contained in:
1 parent
fed99fb0a7
commit
f00170ba5c
9 files changed
+29
-17
No files matched your search
@@ -4,7 +4,7 @@
|
||||
<el-col :xs="8" :sm="6" :md="4" :lg="3" :xl="3" v-for="(item, index) in navMenuList" :key="index">
|
||||
<div
|
||||
:class="['nav-menu-item-top', item.id == currentActiveMenuId ? 'nav-menu-item-active' : '']"
|
||||
@click="currentActiveMenuId = item.id"
|
||||
@click="handleClickMenvLevel1(item)"
|
||||
>
|
||||
<el-image class="nav-menu-item-icon" :src="imageBaseUrl + item.menuPic" fit="cover" />
|
||||
<div class="nav-menu-item-name">{{ $t(item.name) }}</div>
|
||||
@@ -74,13 +74,14 @@ const imageBaseUrl = import.meta.env.VITE_IMAGE_BASE_PATH
|
||||
const getNavMenuList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await menuApi.getAdminMenu().finally(() => (loading.value = false))
|
||||
const res = await menuApi.getAdminMenu()
|
||||
if (res.code == 0 && res.data.length > 0) {
|
||||
navMenuList.value = res.data
|
||||
}
|
||||
} catch (error) {
|
||||
navMenuList.value = []
|
||||
ElMessage.error("加载错误")
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
@@ -96,6 +97,13 @@ const navMenuListBottom = computed(() => {
|
||||
}
|
||||
})
|
||||
|
||||
// 点击一级菜单
|
||||
const handleClickMenvLevel1 = (item: any) => {
|
||||
currentActiveMenuId.value = item.id
|
||||
if (item.children && item.children.length > 0) return
|
||||
router.push(item.path)
|
||||
}
|
||||
|
||||
// 点击菜单项
|
||||
const handleClickBottomMenu = (item: any) => {
|
||||
curLevel2ActiveMenuId.value = item.id
|
||||
|
||||
Reference in new issue
Block a user