feat: 系统设置添加主题动态切换

This commit is contained in:
郝先瑞
2022-03-01 23:45:07 +08:00
parent 108aeeb43a
commit a6882db1dd
9 changed files with 170 additions and 56 deletions

View File

@@ -6,7 +6,7 @@
<script setup lang="ts">
import {computed, ref, watch} from "vue";
import {computed, onMounted, ref, watch} from "vue";
import {useAppStoreHook} from "@/store/modules/app";
import {ElConfigProvider} from 'element-plus'
@@ -29,5 +29,9 @@ watch(language, (value) => {
// 初始化立即执行,
immediate: true
})
onMounted(()=>{
const style = localStorage.getItem("style");
document.documentElement.style.cssText = style as string;
})
</script>