diff --git a/src/client/theme-default/composables/langs.ts b/src/client/theme-default/composables/langs.ts index 4d105cd7..c28a58d4 100644 --- a/src/client/theme-default/composables/langs.ts +++ b/src/client/theme-default/composables/langs.ts @@ -1,4 +1,4 @@ -import { computed } from 'vue' +import { computed, watch } from 'vue' import { ensureStartingSlash } from '../support/utils' import { useData } from './data' import { hashRef } from './hash' @@ -15,6 +15,10 @@ export function useLangs({ (localeIndex.value === 'root' ? '/' : `/${localeIndex.value}/`) })) + watch(page, () => { + hashRef.value = location.hash ? location.hash : '' + }) + const localeLinks = computed(() => Object.entries(site.value.locales).flatMap(([key, value]) => removeCurrent && currentLang.value.label === value.label