1
0
Fork 0
forked from forks/qmk_firmware
qmk_firmware/builddefs/docsgen/.vitepress/theme/QMKLayout.vue
2024-05-30 12:00:41 +10:00

19 lines
483 B
Vue

<script setup>
import DefaultTheme from 'vitepress/theme'
import { useRouter } from 'vitepress'
import { onBeforeMount } from 'vue';
const router = useRouter()
onBeforeMount(async () => {
if (window.location.href.includes('/#/')) {
const newUrl = window.location.href.replace(/\/#\//, '/').replace(/\?id=/, '#');
window.history.replaceState({}, '', newUrl);
await router.go(newUrl);
}
});
</script>
<template>
<DefaultTheme.Layout/>
</template>