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

Loading…
Cancel
Save