feat: add link support to hash

This commit is contained in:
Valerio Ageno
2024-08-16 11:21:18 +02:00
parent 63fc2b9855
commit 51e01ec142
+6
View File
@@ -24,6 +24,12 @@ export default function Link(
const handleTransition = (e: MouseEvent<HTMLAnchorElement>): void => {
e.preventDefault()
props.onClick?.(e)
if (props.href?.startsWith('#')) {
window.location.hash = props.href
return
}
router.push(props.href || '')
}