Files
gil-wiki/reference/4.api/3.utils/preload-route-components.md
gil 5f664546cf feat: 위키 저장소 초기 커밋
- CLAUDE.md 운영 규칙
- wiki/ 정리된 지식 페이지 (Nuxt + Claude Code)
- raw/ 원본 자료
- reference/ Nuxt 4.x 공식 문서

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-13 00:31:51 +09:00

1.2 KiB

title, description, links
title description links
preloadRouteComponents preloadRouteComponents allows you to manually preload individual pages in your Nuxt app.
label icon to size
Source i-simple-icons-github https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/app/composables/preload.ts xs

Preloading routes loads the components of a given route that the user might navigate to in future. This ensures that the components are available earlier and less likely to block the navigation, improving performance.

::tip{icon="i-lucide-rocket"} Nuxt already automatically preloads the necessary routes if you're using the NuxtLink component. ::

:read-more{to="/docs/4.x/api/components/nuxt-link"}

Example

Preload a route when using navigateTo.

// we don't await this async function, to avoid blocking rendering
// this component's setup function
preloadRouteComponents('/dashboard')

const submit = async () => {
  const results = await $fetch('/api/authentication')

  if (results.token) {
    await navigateTo('/dashboard')
  }
}

:read-more{to="/docs/4.x/api/utils/navigate-to"}

::note On server, preloadRouteComponents will have no effect. ::