fix: page changes reset the hash when with i18n

pull/3637/head
zonemeen 2 years ago
parent f6bd99eb13
commit 59e1773623

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

Loading…
Cancel
Save