...

/

NuxtLink and Prefetching

NuxtLink and Prefetching

Understand routing by using NuxtLink and discover how Nuxt will prefetch routes.

Switching between pages manually by changing the URL is not practical for users and a better way is to provide navigation links. The traditional way of switching between pages with HTML is by using the anchor tag <a>:

Press + to interact
<a href="https://example.com">Go to link</a>

The NuxtLink component

Nuxt has a component called NuxtLink. Behind the scenes, NuxtLink still renders an <a> element, but has some additional benefits. The href attribute is automatically set to the route of the page, and a full page refresh (default with <a>) is prevented so the router can handle ...