forked from Mirrors/elk
chore: cleanup checks
This commit is contained in:
parent
c9d70de38e
commit
8e19574ea1
1 changed files with 1 additions and 1 deletions
|
@ -4,7 +4,7 @@ export default defineNuxtPlugin((nuxt) => {
|
|||
scrollToTop: (evt?: MouseEvent | KeyboardEvent) => {
|
||||
const path = evt?.composedPath?.() as HTMLElement[]
|
||||
const el = path?.find(el => el.tagName?.toUpperCase() === 'A') as HTMLAnchorElement
|
||||
if (el && el.href) {
|
||||
if (el?.href) {
|
||||
if (nuxt.$preventScrollToTop(new URL(el.href, import.meta.url).pathname))
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue