Unverified 提交 b6534122 作者: zmtlwzy 提交者: GitHub

fixed: (update pageTitle when change local) (#1278)

If AppLocalePicker reload prop is false, Should be updated when changing the language
上级 a530ec86
...@@ -3,6 +3,7 @@ import { useI18n } from '/@/hooks/web/useI18n'; ...@@ -3,6 +3,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
import { useTitle as usePageTitle } from '@vueuse/core'; import { useTitle as usePageTitle } from '@vueuse/core';
import { useGlobSetting } from '/@/hooks/setting'; import { useGlobSetting } from '/@/hooks/setting';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { useLocaleStore } from '/@/store/modules/locale';
import { REDIRECT_NAME } from '/@/router/constant'; import { REDIRECT_NAME } from '/@/router/constant';
...@@ -13,11 +14,12 @@ export function useTitle() { ...@@ -13,11 +14,12 @@ export function useTitle() {
const { title } = useGlobSetting(); const { title } = useGlobSetting();
const { t } = useI18n(); const { t } = useI18n();
const { currentRoute } = useRouter(); const { currentRoute } = useRouter();
const localeStore = useLocaleStore();
const pageTitle = usePageTitle(); const pageTitle = usePageTitle();
watch( watch(
() => currentRoute.value.path, [() => currentRoute.value.path, () => localeStore.getLocale],
() => { () => {
const route = unref(currentRoute); const route = unref(currentRoute);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论