From e19cc5a0ebec3fcfb23bb14bc236d080d8f380a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=9D=E5=85=88=E7=91=9E?= <1490493387@qq.com> Date: Thu, 24 Mar 2022 23:52:02 +0800 Subject: [PATCH] =?UTF-8?q?sytle(App.vue):=20=E4=BB=A3=E7=A0=81=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/App.vue b/src/App.vue index 1c5f58e5..fa232262 100644 --- a/src/App.vue +++ b/src/App.vue @@ -11,16 +11,16 @@ import { ElConfigProvider } from "element-plus"; import { localStorage } from "@/utils/storage"; import useStore from "@/store"; -//官方文档: https://element-plus.gitee.io/zh-CN/guide/i18n.html - // 导入 Element Plus 语言包 import zhCn from "element-plus/es/locale/lang/zh-cn"; import en from "element-plus/es/locale/lang/en"; const { app } = useStore(); + const language = computed(() => app.language); const locale = ref(); + watch( language, (value) => { @@ -31,10 +31,11 @@ watch( } }, { - // 初始化立即执行, - immediate: true, + // 初始化立即执行 + immediate: true } ); + onMounted(() => { const style = localStorage.get("style"); document.documentElement.style.cssText = style as string;