sytle(App.vue): 代码格式调整
This commit is contained in:
@@ -11,16 +11,16 @@ import { ElConfigProvider } from "element-plus";
|
|||||||
import { localStorage } from "@/utils/storage";
|
import { localStorage } from "@/utils/storage";
|
||||||
import useStore from "@/store";
|
import useStore from "@/store";
|
||||||
|
|
||||||
//官方文档: https://element-plus.gitee.io/zh-CN/guide/i18n.html
|
|
||||||
|
|
||||||
// 导入 Element Plus 语言包
|
// 导入 Element Plus 语言包
|
||||||
import zhCn from "element-plus/es/locale/lang/zh-cn";
|
import zhCn from "element-plus/es/locale/lang/zh-cn";
|
||||||
import en from "element-plus/es/locale/lang/en";
|
import en from "element-plus/es/locale/lang/en";
|
||||||
|
|
||||||
const { app } = useStore();
|
const { app } = useStore();
|
||||||
|
|
||||||
const language = computed(() => app.language);
|
const language = computed(() => app.language);
|
||||||
|
|
||||||
const locale = ref();
|
const locale = ref();
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
language,
|
language,
|
||||||
(value) => {
|
(value) => {
|
||||||
@@ -31,10 +31,11 @@ watch(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// 初始化立即执行,
|
// 初始化立即执行
|
||||||
immediate: true,
|
immediate: true
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const style = localStorage.get("style");
|
const style = localStorage.get("style");
|
||||||
document.documentElement.style.cssText = style as string;
|
document.documentElement.style.cssText = style as string;
|
||||||
|
|||||||
Reference in New Issue
Block a user