mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-08-05 12:07:22 -04:00
21 lines
574 B
Vue
21 lines
574 B
Vue
<script setup lang="ts">
|
|
const router = useRouter();
|
|
|
|
router.afterEach(async (to, from) => {
|
|
if (to.path !== from.path) {
|
|
await nextTick();
|
|
// reset the focus to the start of the document
|
|
// so that the skip link is the first element in tab order after navigation
|
|
document.body.tabIndex = 0;
|
|
document.body.focus();
|
|
document.body.tabIndex = -1;
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<a ref="link" href="#main" class="sr-only sr-only-focusable position-fixed top-0 z-1">
|
|
<T>home.skipToContent</T>
|
|
</a>
|
|
</template>
|