diff --git a/src/components/FileTree.tsx b/src/components/FileTree.tsx index 76a7c3e..ea3e29b 100644 --- a/src/components/FileTree.tsx +++ b/src/components/FileTree.tsx @@ -115,7 +115,7 @@ export const HeadingNode: Component<{ if (e.button === 0) { // Left-click: use SPA navigation e.preventDefault(); - navigate(href()); + navigate(`${props.basePath}#${anchor}`); } // Middle-click / right-click: let the browser handle the natively // 滚动到目标元素,考虑导航栏高度偏移