From c7fea64ae7528a4c6d072a56571c9a34b1b69afd Mon Sep 17 00:00:00 2001 From: QihuAI Design Date: Mon, 13 Jul 2026 15:48:06 +0800 Subject: [PATCH] =?UTF-8?q?chore(frontend):=20=E6=B8=85=E7=90=86=20Landing?= =?UTF-8?q?Page=20=E4=B8=AD=E5=85=B3=E4=BA=8E=20HashRouter=20=E7=9A=84?= =?UTF-8?q?=E5=8E=86=E5=8F=B2=E6=B3=A8=E9=87=8A=EF=BC=88=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=B7=B2=E8=BF=81=20BrowserRouter=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/front/LandingPage.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/front/LandingPage.tsx b/frontend/src/pages/front/LandingPage.tsx index a45fc6f..7790623 100644 --- a/frontend/src/pages/front/LandingPage.tsx +++ b/frontend/src/pages/front/LandingPage.tsx @@ -111,8 +111,8 @@ const LandingPage: React.FC = () => { else window.scrollTo({ top: 0, behavior: 'smooth' }); }; - // HashRouter 下原生 会被当成路由路径解析,导致菜单失效; - // 故改为编程式滚动 + preventDefault,仅在 LandingPage 内部滚动容器内跳转。 + // 页内锚点导航:原生 会触发路由跳转而非滚动, + // 故改为编程式 scrollIntoView + preventDefault,仅在 LandingPage 内部滚动容器内跳转。 const anchorClick = (id: string, after?: () => void) => (e: React.MouseEvent) => { e.preventDefault(); document.getElementById(id)?.scrollIntoView({ behavior: 'smooth', block: 'start' });