Routing
Most websites have more than just one page. For example a home page, about page, contact page etc. In order to show these pages we need a Router.
Automatic Routes
Most websites will have more than one page (i.e. a home page, about page, contact page, etc.). In order to show these pages, we need a Router. That's where vue-router comes in. When working with the Vue application, you have to set up a configuration file (i.e. router.js) and add all your routes manually to it. Nuxt automatically generates the vue-router configuration for you, based on your provided Vue files inside the pages directory. That means you never have to write a router config again! Nuxt also gives you automatic code-splitting for all your routes.
In other words, all you have to do to have routing in your application is to create .vue files in the pages folder.
Navigation
To navigate between pages of your app, you should use the NuxtLink component. This component is included with Nuxt and therefore you don't have to import it as you do with other components. It is similar to the HTML <a> tag, except that instead of using a href="/about" we use to="/about". If you have used vue-router before, you can think of the <NuxtLink> as a replacement for <RouterLink>
A simple link to the index.vue page in your pages folder:
<template>
<NuxtLink to="/">Home page</NuxtLink>
</template>
For all links to pages within your site, use <NuxtLink>. If you have links to other websites you should use the <a> tag. See below for an example:
<template>
<main>
<h1>Home page</h1>
<NuxtLink to="/about">
About (internal link that belongs to the Nuxt App)
</NuxtLink>
<a href="https://v2.nuxt.com">External Link to another page</a>
</main>
</template>
Sébastien Chopin
Nazaré da Piedade
Nobu
川音리오
Maciek Palmowski
Nestor Vera
Daniel Roe
Yue Yang
Jeronimas
Clément Ollivier
Alexander Lichter
N3-rd
Adrien Zaganelli
Mag
Stefan Huber
Olga Bulat
Paiva
Florian Reuschel
Savas Vedova
HIJACK
Vinícius Alves
Kareem Dabbeet
Valentín Costa
Ryan Skinner
Alex Hirzel
Ajeet Chaulagain
René Eschke
Nico Devs
Muhammad
Naoki Hamada
Tom
Yann Aufray
Anthony Chu
Nuzhat Minhaz
Lucas Portet
Richard Schloss
Bobby
bpy
Antony Konstantinidis
Hibariya
Jose Seabra
Eze
Florian Lefebvre
Lucas Recoaro
Julien SEIXAS