菜单图标显示控制

This commit is contained in:
Gary Fu
2024-03-31 11:16:27 +08:00
parent 8e607cbaa2
commit 01dfa4fd6f
2 changed files with 5 additions and 2 deletions

View File

@@ -94,7 +94,7 @@ const allMenus = [
{ {
id: 25, id: 25,
parentId: 2, parentId: 2,
iconCls: 'TipsAndUpdatesOutlined', iconCls: 'DynamicFormFilled',
nameCn: '窗口表单示例', nameCn: '窗口表单示例',
nameEn: 'Window Forms', nameEn: 'Window Forms',
menuUrl: '/window-forms' menuUrl: '/window-forms'

View File

@@ -2,6 +2,7 @@
import { computed } from 'vue' import { computed } from 'vue'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { useGlobalConfigStore } from '@/stores/GlobalConfigStore' import { useGlobalConfigStore } from '@/stores/GlobalConfigStore'
import { GlobalLayoutMode } from '@/consts/GlobalConstants'
const router = useRouter() const router = useRouter()
const globalConfigStore = useGlobalConfigStore() const globalConfigStore = useGlobalConfigStore()
@@ -48,7 +49,9 @@ const dropdownClick = (menuItem, $event) => {
} }
const checkShowMenuIcon = menuItem => { const checkShowMenuIcon = menuItem => {
return menuItem.icon && (globalConfigStore.showMenuIcon || (!menuItem.labelKey && !menuItem.label)) return menuItem.icon && (globalConfigStore.showMenuIcon ||
(!menuItem.labelKey && !menuItem.label) ||
(globalConfigStore.isCollapseLeft && globalConfigStore.layoutMode === GlobalLayoutMode.LEFT))
} }
const showMenuIcon = computed(() => { const showMenuIcon = computed(() => {