2
0

fix:动态菜单中英适配(刷新界面实现)

This commit is contained in:
zhongzm
2025-02-11 17:04:02 +08:00
parent e74db62c27
commit d94c35ed49
2 changed files with 11 additions and 0 deletions

View File

@@ -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 */

View File

@@ -164,6 +164,7 @@ declare global {
const getFixedTabIds: typeof import('../store/modules/tab/shared')['getFixedTabIds']
const getFixedTabs: typeof import('../store/modules/tab/shared')['getFixedTabs']
const getGlobalMenusByAuthRoutes: typeof import('../store/modules/route/shared')['getGlobalMenusByAuthRoutes']
const getLocalizedTimeUnit: typeof import('../utils/units')['getLocalizedTimeUnit']
const getRouteIcons: typeof import('../store/modules/tab/shared')['getRouteIcons']
const getSelectedMenuKeyPathByKey: typeof import('../store/modules/route/shared')['getSelectedMenuKeyPathByKey']
const getServiceBaseURL: typeof import('../utils/service')['getServiceBaseURL']
@@ -356,6 +357,7 @@ declare global {
const useFocus: typeof import('@vueuse/core')['useFocus']
const useFocusWithin: typeof import('@vueuse/core')['useFocusWithin']
const useFormRules: typeof import('../hooks/common/form')['useFormRules']
const useFormatTime: typeof import('../utils/units')['useFormatTime']
const useFps: typeof import('@vueuse/core')['useFps']
const useFullscreen: typeof import('@vueuse/core')['useFullscreen']
const useGamepad: typeof import('@vueuse/core')['useGamepad']
@@ -438,6 +440,7 @@ declare global {
const useThrottleFn: typeof import('@vueuse/core')['useThrottleFn']
const useThrottledRefHistory: typeof import('@vueuse/core')['useThrottledRefHistory']
const useTimeAgo: typeof import('@vueuse/core')['useTimeAgo']
const useTimeUnits: typeof import('../utils/units')['useTimeUnits']
const useTimeout: typeof import('@vueuse/core')['useTimeout']
const useTimeoutFn: typeof import('@vueuse/core')['useTimeoutFn']
const useTimeoutPoll: typeof import('@vueuse/core')['useTimeoutPoll']