fix: store loadingText as key and localize on render (#12022)

This commit is contained in:
ssongliu
2026-03-02 10:32:01 +00:00
committed by GitHub
parent d70f903432
commit 133140040b
2 changed files with 5 additions and 3 deletions
+4 -2
View File
@@ -62,6 +62,7 @@ import { useRoute, useRouter } from 'vue-router';
import { loadMasterProductProFromDB, loadProductProFromDB } from '@/utils/xpack';
import { useTheme } from '@/global/use-theme';
import TaskList from '@/components/task-list/index.vue';
import i18n from '@/lang';
const { switchTheme } = useTheme();
useResize();
@@ -80,7 +81,9 @@ const globalStore = GlobalStore();
const tabsStore = TabsStore();
const loading = ref(false);
const loadingText = ref();
const loadingText = computed(() =>
globalStore.loadingText ? i18n.global.t(`commons.loadingText.${globalStore.loadingText}`) : '',
);
let timer: NodeJS.Timer | null = null;
@@ -140,7 +143,6 @@ const toLogin = () => {
const loadStatus = async () => {
loading.value = globalStore.isLoading;
loadingText.value = globalStore.loadingText;
if (loading.value) {
timer = setInterval(async () => {
await getSystemAvailable()
+1 -1
View File
@@ -77,7 +77,7 @@ const GlobalStore = defineStore({
this.isLoading = loading;
},
setLoadingText(text: string) {
this.loadingText = i18n.global.t('commons.loadingText.' + text);
this.loadingText = text;
},
setCsrfToken(token: string) {
this.csrfToken = token;