From 4d280145482064d6b9cd29e0209d286419f22bc3 Mon Sep 17 00:00:00 2001 From: Uyarn Date: Tue, 30 May 2023 11:59:36 +0800 Subject: [PATCH] feat: resolve type error --- src/layouts/setting/page-config.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/layouts/setting/page-config.vue b/src/layouts/setting/page-config.vue index 87dc6b0..c06de7a 100644 --- a/src/layouts/setting/page-config.vue +++ b/src/layouts/setting/page-config.vue @@ -97,6 +97,7 @@ const initStyleConfig = () => { const styleConfig = STYLE_CONFIG; for (const key in styleConfig) { if (Object.prototype.hasOwnProperty.call(styleConfig, key)) { + // @ts-ignore styleConfig[key] = settingStore[key]; } } @@ -123,7 +124,7 @@ const getModeIcon = (mode: string) => { dark: SettingDarkIcon, auto: SettingAutoIcon, }; - return modeIconMap[mode]; + return modeIconMap[mode as 'light' | 'dark' | 'auto']; }; const getLayoutIcon = (mode: string) => { @@ -132,7 +133,7 @@ const getLayoutIcon = (mode: string) => { top: LayoutTopIcon, mix: LayoutMixIcon, }; - return layoutIconMap[mode]; + return layoutIconMap[mode as 'side' | 'top' | 'mix']; }; const handleCloseDrawer = () => {