locale ru
This commit is contained in:
29
src/App.vue
29
src/App.vue
@ -1,10 +1,37 @@
|
||||
<template>
|
||||
<router-view />
|
||||
<el-config-provider :locale="locale_el">
|
||||
<router-view />
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import ru from "element-plus/dist/locale/ru";
|
||||
import zhCn from "element-plus/dist/locale/zh-cn";
|
||||
import useSettingsStore from "@/store/modules/settings";
|
||||
import { handleThemeStyle } from "@/utils/theme";
|
||||
import { computed, watch } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
|
||||
const settingsStore = useSettingsStore();
|
||||
const { locale } = useI18n();
|
||||
|
||||
const locale_el = computed(() => {
|
||||
let locale = zhCn;
|
||||
if (settingsStore.locale === "zh") {
|
||||
locale = zhCn;
|
||||
} else if (settingsStore.locale === "ru") {
|
||||
locale = ru;
|
||||
}
|
||||
return locale;
|
||||
});
|
||||
|
||||
watch(
|
||||
() => settingsStore.locale,
|
||||
(newVal) => {
|
||||
locale.value = newVal;
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
|
||||
Reference in New Issue
Block a user