Open In App

NuxtJS Directory Structure

In this article, we are going to learn about the directory structure of NuxtJs. Nuxt.js is a free and open-source web application framework based on Vue.js, Node.js, Webpack, and Babel.js. Nuxt is inspired by Next.js, which is a framework of similar purpose, based on React.js.

Create NuxtJS Application:



Step 1: You can create a new NuxtJs project using the below command:

npx create-nuxt-app gfg

 



Step 2: Now navigate to your app using the following command:

cd gfg

Project Structure: It will look like this.

There are 7 main sub directories in NuxtJs:

Example: In this example, let’s create a new page. For this, we have to create a new file with the name gfg.vue inside our pages directory. Add the below content in the file:




<template>
  <div>
    <h3>This is a simple NuxtJs Page.</h3> 
  </div>
</template>

Run the app: Run the app using the below command in the terminal.

npm run dev

Output:

Reference:https://nuxtjs.org/docs/get-started/directory-structure/

Article Tags :