mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-29 17:07:22 +00:00
fix(nuxt): only observe tag elements for <NuxtLink>
prefetching (#7679)
This commit is contained in:
parent
42c086223f
commit
98ce2e6492
@ -197,7 +197,7 @@ export function defineNuxtLink (options: NuxtLinkOptions) {
|
|||||||
let unobserve: Function | null = null
|
let unobserve: Function | null = null
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
idleId = requestIdleCallback(() => {
|
idleId = requestIdleCallback(() => {
|
||||||
if (el?.value) {
|
if (el?.value?.tagName) {
|
||||||
unobserve = observer!.observe(el.value, async () => {
|
unobserve = observer!.observe(el.value, async () => {
|
||||||
unobserve?.()
|
unobserve?.()
|
||||||
unobserve = null
|
unobserve = null
|
||||||
|
Loading…
Reference in New Issue
Block a user