Hichem 4 weeks ago committed by GitHub
commit 55513ef987
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -13,6 +13,11 @@ const marker = ref()
const { headers, hasLocalNav } = useLayout() const { headers, hasLocalNav } = useLayout()
useActiveAnchor(container, marker) useActiveAnchor(container, marker)
function scrollToTop() {
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' })
}
</script> </script>
<template> <template>
@ -35,6 +40,11 @@ useActiveAnchor(container, marker)
</div> </div>
<VPDocOutlineItem :headers :root="true" /> <VPDocOutlineItem :headers :root="true" />
<button @click="scrollToTop" class="back-to-top-button">
<span>{{ theme.returnToTopLabel || 'Return to top' }}</span>
</button>
</div> </div>
</nav> </nav>
</template> </template>
@ -56,6 +66,12 @@ useActiveAnchor(container, marker)
font-weight: 500; font-weight: 500;
} }
.back-to-top-button {
line-height: 32px;
font-weight: 500;
font-size: 14px;
}
.outline-marker { .outline-marker {
position: absolute; position: absolute;
top: 32px; top: 32px;

Loading…
Cancel
Save