fix:动态菜单中英适配(刷新界面实现)
This commit is contained in:
@@ -11,6 +11,7 @@ import { useRouteStore } from '../route';
|
||||
import { useTabStore } from '../tab';
|
||||
import { useThemeStore } from '../theme';
|
||||
|
||||
|
||||
export const useAppStore = defineStore(SetupStoreId.App, () => {
|
||||
const themeStore = useThemeStore();
|
||||
const routeStore = useRouteStore();
|
||||
@@ -58,9 +59,16 @@ export const useAppStore = defineStore(SetupStoreId.App, () => {
|
||||
];
|
||||
|
||||
function changeLocale(lang: App.I18n.LangType) {
|
||||
if (locale.value === lang) return;
|
||||
|
||||
locale.value = lang;
|
||||
setLocale(lang);
|
||||
localStg.set('lang', lang);
|
||||
|
||||
//routeStore.updateGlobalMenusByLocale();
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 100);
|
||||
}
|
||||
|
||||
/** Update document title by locale */
|
||||
|
||||
Reference in New Issue
Block a user