From dc1b192f47161accd82850fcfed577943abd74a8 Mon Sep 17 00:00:00 2001 From: gushen610140 Date: Tue, 17 Feb 2026 22:04:35 +0800 Subject: [PATCH] feat: set nav by reset scroll --- src/components/menu/NavBar.vue | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/components/menu/NavBar.vue b/src/components/menu/NavBar.vue index 2a4f6f2..6efcb40 100644 --- a/src/components/menu/NavBar.vue +++ b/src/components/menu/NavBar.vue @@ -23,6 +23,11 @@ const handleThrottleScroll = throttle(100, () => { }); window.addEventListener("scroll", handleThrottleScroll); + +const navPageByResetScroll = (path: string) => { + window.scrollTo({ top: 0, behavior: "smooth" }); + navigateTo(path); +};