From 30e8c5feab20786ccec0a24bbb1fcf976c2cf93e Mon Sep 17 00:00:00 2001 From: Hichem Fantar Date: Sat, 25 Jan 2025 21:18:46 +0100 Subject: [PATCH] feat: add scroll to top button in VPDocAsideOutline component --- .../theme-default/components/VPDocAsideOutline.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/client/theme-default/components/VPDocAsideOutline.vue b/src/client/theme-default/components/VPDocAsideOutline.vue index 00ea9bbe..b8a2f1e1 100644 --- a/src/client/theme-default/components/VPDocAsideOutline.vue +++ b/src/client/theme-default/components/VPDocAsideOutline.vue @@ -22,6 +22,11 @@ const container = ref() const marker = ref() useActiveAnchor(container, marker) + +function scrollToTop() { + window.scrollTo({ top: 0, left: 0, behavior: 'smooth' }) +} +