chore: simplify code

pull/2562/head
Divyansh Singh 1 year ago committed by GitHub
parent 6b98113a42
commit 00d94e9ee5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -7,8 +7,8 @@ defineProps<{
}>() }>()
function onClick({ target: el }: Event) { function onClick({ target: el }: Event) {
const id = '#' + (el as HTMLAnchorElement).href!.split('#')[1] const id = (el as HTMLAnchorElement).href!.split('#')[1]
const heading = document.getElementById(decodeURIComponent(id).slice(1)) const heading = document.getElementById(decodeURIComponent(id))
heading?.focus() heading?.focus()
} }
</script> </script>

Loading…
Cancel
Save