mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-19 01:45:53 +00:00
fix(nuxt): defer adding route path to preloaded record (#18862)
This commit is contained in:
parent
2677b88f5f
commit
526a78095a
@ -39,7 +39,6 @@ export async function preloadRouteComponents (to: string, router: Router & { _ro
|
|||||||
|
|
||||||
if (!router._routePreloaded) { router._routePreloaded = new Set() }
|
if (!router._routePreloaded) { router._routePreloaded = new Set() }
|
||||||
if (router._routePreloaded.has(to)) { return }
|
if (router._routePreloaded.has(to)) { return }
|
||||||
router._routePreloaded.add(to)
|
|
||||||
|
|
||||||
const promises = router._preloadPromises = router._preloadPromises || []
|
const promises = router._preloadPromises = router._preloadPromises || []
|
||||||
|
|
||||||
@ -48,6 +47,8 @@ export async function preloadRouteComponents (to: string, router: Router & { _ro
|
|||||||
return Promise.all(promises).then(() => preloadRouteComponents(to, router))
|
return Promise.all(promises).then(() => preloadRouteComponents(to, router))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
router._routePreloaded.add(to)
|
||||||
|
|
||||||
const components = router.resolve(to).matched
|
const components = router.resolve(to).matched
|
||||||
.map(component => component.components?.default)
|
.map(component => component.components?.default)
|
||||||
.filter(component => typeof component === 'function')
|
.filter(component => typeof component === 'function')
|
||||||
|
Loading…
Reference in New Issue
Block a user