fix(nuxt): avoid preloading external routes (#8255)

This commit is contained in:
Daniel Roe 2022-10-17 18:54:32 +01:00 committed by GitHub
parent 931ebec376
commit a90b303d97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -204,7 +204,7 @@ export function defineNuxtLink (options: NuxtLinkOptions) {
unobserve = null
await Promise.all([
nuxtApp.hooks.callHook('link:prefetch', to.value as string).catch(() => {}),
preloadRouteComponents(to.value as string, router).catch(() => {})
!isExternal.value && preloadRouteComponents(to.value as string, router).catch(() => {})
])
prefetched.value = true
})