Browse Source

fix: 切换时区后,页面不刷新 (#7085)

* fix: 切换时区后,页面不刷新

* fix: keep-alive 的页面,i18n 和 timezone 不更新
pull/7096/head
yuhengshen 4 weeks ago
committed by GitHub
parent
commit
343d8a1c1e
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 15
      packages/effects/layouts/src/basic/layout.vue

15
packages/effects/layouts/src/basic/layout.vue

@ -14,7 +14,7 @@ import {
updatePreferences,
usePreferences,
} from '@vben/preferences';
import { useAccessStore } from '@vben/stores';
import { useAccessStore, useTabbarStore, useTimezoneStore } from '@vben/stores';
import { cloneDeep, mapTree } from '@vben/utils';
import { VbenAdminLayout } from '@vben-core/layout-ui';
@ -52,6 +52,7 @@ const {
theme,
} = usePreferences();
const accessStore = useAccessStore();
const timezoneStore = useTimezoneStore();
const { refresh } = useRefresh();
const sidebarTheme = computed(() => {
@ -187,9 +188,19 @@ watch(
},
);
const tabbarStore = useTabbarStore();
function refreshAll() {
tabbarStore.cachedTabs.clear();
refresh();
}
//
// i18n.global.localepreference.app.localewatchpreference.app.locale
watch(i18n.global.locale, refresh, { flush: 'post' });
watch(i18n.global.locale, refreshAll, { flush: 'post' });
//
watch(() => timezoneStore.timezone, refreshAll, { flush: 'post' });
const slots: SetupContext['slots'] = useSlots();
const headerSlots = computed(() => {

Loading…
Cancel
Save