fix(FileTree): use base path for anchor navigation

This commit is contained in:
hypercross 2026-07-14 15:23:30 +08:00
parent f877a58a31
commit d78d15d8ec
1 changed files with 1 additions and 1 deletions

View File

@ -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 <a> natively
// 滚动到目标元素,考虑导航栏高度偏移