mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
refactor(projects): 去除在pinia的getters的函数调用副作用,用watch代替
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { darkTheme } from 'naive-ui';
|
||||
import { getThemeSettings, getNaiveThemeOverrides, addThemeCssVarsToHtml } from './helpers';
|
||||
import { getThemeSettings, getNaiveThemeOverrides } from './helpers';
|
||||
|
||||
type ThemeState = Theme.Setting;
|
||||
|
||||
@ -10,9 +10,6 @@ export const useThemeStore = defineStore('theme-store', {
|
||||
/** naiveUI的主题配置 */
|
||||
naiveThemeOverrides(state) {
|
||||
const overrides = getNaiveThemeOverrides({ primary: state.themeColor, ...state.otherColor });
|
||||
if (overrides.common) {
|
||||
addThemeCssVarsToHtml(overrides.common);
|
||||
}
|
||||
return overrides;
|
||||
},
|
||||
/** naive-ui暗黑主题 */
|
||||
|
Reference in New Issue
Block a user