mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-11-10 03:30:53 +08:00
fix: 解决刷新之后获取不到 i18n 配置的问题
This commit is contained in:
parent
8074200996
commit
345cc3d955
4 changed files with 4 additions and 4 deletions
|
|
@ -23,8 +23,6 @@ const i18nLocale = computed((): any => {
|
||||||
return '';
|
return '';
|
||||||
});
|
});
|
||||||
|
|
||||||
// const assemblySize = computed((): string => globalStore.assemblySize);
|
|
||||||
|
|
||||||
let isRouterAlive = ref(true);
|
let isRouterAlive = ref(true);
|
||||||
|
|
||||||
const reload = () => {
|
const reload = () => {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import en from './modules/en';
|
||||||
|
|
||||||
const i18n = createI18n({
|
const i18n = createI18n({
|
||||||
legacy: false,
|
legacy: false,
|
||||||
locale: 'zh',
|
locale: localStorage.getItem('lang') || 'zh',
|
||||||
globalInjection: true,
|
globalInjection: true,
|
||||||
messages: {
|
messages: {
|
||||||
zh,
|
zh,
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ export const GlobalStore = defineStore({
|
||||||
},
|
},
|
||||||
updateLanguage(language: any) {
|
updateLanguage(language: any) {
|
||||||
this.language = language;
|
this.language = language;
|
||||||
|
localStorage.setItem('lang', language);
|
||||||
},
|
},
|
||||||
setThemeConfig(themeConfig: ThemeConfigProp) {
|
setThemeConfig(themeConfig: ThemeConfigProp) {
|
||||||
this.themeConfig = themeConfig;
|
this.themeConfig = themeConfig;
|
||||||
|
|
|
||||||
|
|
@ -166,10 +166,11 @@ import { App } from '@/api/interface/app';
|
||||||
import { ElMessageBox } from 'element-plus';
|
import { ElMessageBox } from 'element-plus';
|
||||||
import { dateFormatSimple } from '@/utils/util';
|
import { dateFormatSimple } from '@/utils/util';
|
||||||
import { MsgSuccess } from '@/utils/message';
|
import { MsgSuccess } from '@/utils/message';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
const shortcuts = [
|
const shortcuts = [
|
||||||
{
|
{
|
||||||
text: i18n.global.t('website.ever'),
|
text: useI18n().t('website.ever'),
|
||||||
value: () => {
|
value: () => {
|
||||||
return new Date('1970-01-01');
|
return new Date('1970-01-01');
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue