feat: 无菜单图标时使用默认菜单图标

This commit is contained in:
xlsea
2025-05-16 16:32:32 +08:00
parent e8c83e6bc6
commit 4acce9ca00
2 changed files with 7 additions and 1 deletions

View File

@ -24,6 +24,8 @@ import {
updateLocaleOfGlobalMenus
} from './shared';
const defaultIcon = import.meta.env.VITE_MENU_ICON;
export const useRouteStore = defineStore(SetupStoreId.Route, () => {
const authStore = useAuthStore();
const tabStore = useTabStore();
@ -120,6 +122,8 @@ export const useRouteStore = defineStore(SetupStoreId.Route, () => {
if (route.meta.icon?.startsWith('local-icon-')) {
route.meta.localIcon = route.meta.icon.replace('local-icon-', 'menu-');
delete route.meta.icon;
} else if (!isNotNull(route.meta.icon)) {
route.meta.icon = defaultIcon;
}
// @ts-expect-error no hidden field