fix(FileTree): use base path for anchor navigation
This commit is contained in:
parent
f877a58a31
commit
d78d15d8ec
|
|
@ -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
|
||||
// 滚动到目标元素,考虑导航栏高度偏移
|
||||
|
|
|
|||
Loading…
Reference in New Issue