How to add routes in Nuxtjs


Nuxtjs is a framework which simplifying the development of the Vue project. Vuejs is already super cool framework , why I need another ? Nothing in Vue is changed in Nuxtjs, but it reduce the configuration time required and add some additional feature to it.

Routes

For routes Nuxtjs uses the folder structure. Under the Pages we have a default page, which is the landing page of our Nuxt app. We can create folder to create sub routes and add a file ending with .vue extension to create a routes.

For example we can create about page by creating one file About.vue . For sub route, Products, can create a folder products , then inside folder create a file index.vue ( default home for products).

Suppose you want to access some special route with product id . It can be create in a different way. Inside the Products folder create a file _id.vue in which id is the id of the product.

The following Nuxtjs posts may help you

Published by

Manoj

A developer,teacher and a blogger obsessed with Python,Dart and open source world from India

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.