mirror of
https://github.com/tuono-labs/tuono
synced 2026-07-25 12:52:47 -07:00
feat: add link support to hash
This commit is contained in:
@@ -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 || '')
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user