mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-10-17 23:23:42 +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