fix(components): 修复按钮Tab自适应主题颜色

This commit is contained in:
Soybean
2021-10-14 18:21:17 +08:00
parent 8ba8a4feac
commit 3d1f41925d
9 changed files with 73 additions and 11 deletions

View File

@ -3,10 +3,17 @@ import type { GlobalThemeOverrides } from 'naive-ui';
import { themeSettings, defaultThemeSettings } from '@/settings';
import { store } from '@/store';
import type { ThemeSettings, NavMode, MultiTabMode, AnimateType, HorizontalMenuPosition } from '@/interface';
import { shallowColor } from '@/utils';
import { getHoverAndPressedColor } from './helpers';
type ThemeState = ThemeSettings;
interface relativeThemeColor {
hover: string;
pressed: string;
shallow: string;
}
const themeStore = defineStore({
id: 'theme-store',
state: (): ThemeState => ({
@ -51,6 +58,13 @@ const themeStore = defineStore({
}
};
},
relativeThemeColor(): relativeThemeColor {
const shallow = shallowColor(this.themeColor, 0.1);
return {
...getHoverAndPressedColor(this.themeColor),
shallow
};
},
isVerticalNav(): boolean {
const { mode } = this.navStyle;
return mode === 'vertical' || mode === 'vertical-mix';