feat: resolve type error

This commit is contained in:
Uyarn 2023-05-30 11:59:36 +08:00
parent f7fb462479
commit 4d28014548

View File

@ -97,6 +97,7 @@ const initStyleConfig = () => {
const styleConfig = STYLE_CONFIG; const styleConfig = STYLE_CONFIG;
for (const key in styleConfig) { for (const key in styleConfig) {
if (Object.prototype.hasOwnProperty.call(styleConfig, key)) { if (Object.prototype.hasOwnProperty.call(styleConfig, key)) {
// @ts-ignore
styleConfig[key] = settingStore[key]; styleConfig[key] = settingStore[key];
} }
} }
@ -123,7 +124,7 @@ const getModeIcon = (mode: string) => {
dark: SettingDarkIcon, dark: SettingDarkIcon,
auto: SettingAutoIcon, auto: SettingAutoIcon,
}; };
return modeIconMap[mode]; return modeIconMap[mode as 'light' | 'dark' | 'auto'];
}; };
const getLayoutIcon = (mode: string) => { const getLayoutIcon = (mode: string) => {
@ -132,7 +133,7 @@ const getLayoutIcon = (mode: string) => {
top: LayoutTopIcon, top: LayoutTopIcon,
mix: LayoutMixIcon, mix: LayoutMixIcon,
}; };
return layoutIconMap[mode]; return layoutIconMap[mode as 'side' | 'top' | 'mix'];
}; };
const handleCloseDrawer = () => { const handleCloseDrawer = () => {