From 72a4679c0ad2f7642f3e397efe89c3ed43e169cf Mon Sep 17 00:00:00 2001 From: Azir <79054161+Azir-11@users.noreply.github.com> Date: Fri, 23 Feb 2024 15:27:50 +0800 Subject: [PATCH] fix(projects): Missing default value for tab icon --- src/store/modules/tab/shared.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/store/modules/tab/shared.ts b/src/store/modules/tab/shared.ts index 37634158..9513ab7c 100644 --- a/src/store/modules/tab/shared.ts +++ b/src/store/modules/tab/shared.ts @@ -81,8 +81,8 @@ export function getTabByRoute(route: App.Global.TabRoute) { */ export function getRouteIcons(route: App.Global.TabRoute) { // Set default value for icon at the beginning - let icon: string = import.meta.env.VITE_MENU_ICON; - let localIcon: string | undefined; + let icon: string = route?.meta?.icon || import.meta.env.VITE_MENU_ICON; + let localIcon: string | undefined = route?.meta?.localIcon; // Route.matched only appears when there are multiple matches,so check if route.matched exists if (route.matched) {