fix: update

This commit is contained in:
xiaoxian521
2021-11-10 11:50:29 +08:00
parent b45a10b98f
commit af01d80db2
4 changed files with 9 additions and 12 deletions

View File

@@ -17,7 +17,7 @@ import { debounce } from "/@/utils/debounce";
import { themeColorsType } from "../../types";
import { useAppStoreHook } from "/@/store/modules/app";
import { storageLocal, storageSession } from "/@/utils/storage";
import { addClassNameToHtmlTag } from "@zougt/vite-plugin-theme-preprocessor/dist/browser-utils";
import { toggleTheme } from "@zougt/vite-plugin-theme-preprocessor/dist/browser-utils";
const router = useRouter();
const { isSelect } = useCssModule();
@@ -62,7 +62,7 @@ let layoutTheme =
if (unref(layoutTheme)) {
let layout = unref(layoutTheme).layout;
let theme = unref(layoutTheme).theme;
addClassNameToHtmlTag({
toggleTheme({
scopeName: `layout-theme-${theme}`
});
window.document.body.setAttribute("layout", layout);
@@ -200,7 +200,7 @@ function setLayoutModel(layout: string) {
// 设置导航主题色
function setLayoutThemeColor(theme: string) {
layoutTheme.value.theme = theme;
addClassNameToHtmlTag({
toggleTheme({
scopeName: `layout-theme-${theme}`
});
instance.layout = { layout: useAppStoreHook().layout, theme };