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