refactor: 将多主题功能从 pinia 抽离为 hook

This commit is contained in:
pany
2022-10-17 15:04:27 +08:00
parent e41d1f21a5
commit 281a7bebbf
6 changed files with 54 additions and 53 deletions

View File

@@ -1,11 +1,11 @@
<script lang="ts" setup>
import { useAppStore } from "@/store/modules/app"
import { useTheme } from "@/hooks/useTheme"
import zhCn from "element-plus/lib/locale/lang/zh-cn"
const appStore = useAppStore()
const { initTheme } = useTheme()
/** 初始化主题 */
appStore.initTheme()
initTheme()
/** 将 Element-Plus 的语言设置为中文 */
const locale = zhCn
</script>