Creating Pages and Routes
One of the most admired features of Nuxt.js is the ability to create routes based on the pages you add in the pages
directory. With Nuxt, there is no need to add Vue Router to your project, because it’s already been downloaded and added to the project when you downloaded and installed Nuxt.
If you downloaded the starter template, you’ll see the index.vue
file in the pages
directory. In that file, you’ll see the code that is used to create and animate the Nuxt.js logo. Just like with a standard Apache server, index
automatically maps to the homepage.
Let’s create your own page with it’s generated route. In the pages
directory, create a .vue
file and name it, contact-us.vue
. Inside of the page component, create a HTML <form>
with some <input>
fields and a <textarea>
. This form doesn’t need to do anything. Now, go to your web browser and in the URL, go to that page: localhost:3000/contact-us
. You should...