The Wayback Machine - https://web.archive.org/web/20230502150129/https://www.geeksforgeeks.org/nuxtjs/
Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

NuxtJS

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

Nuxt.js is a library built upon VueJS that is used for creating full-stack web applications. It provides a wide variety of features that makes development fast and easy. It is a framework that does a similar task to Next.js but is mostly used for server-side rendering.

Nuxt.js is an open-source server-side framework and has many contributors who are constantly upgrading its features. Nuxt.js provides a variety of modules and themes for a smooth production experience. Also, deployment with Nuxt.js is very easy.

NuxtJS Tutorial

 

Nuxt.js does not require much configuration and the directory structure, as well as conventions, are easy to understand. It provides different rendering modes which allow us to run our application according to our demand. Importing and extension of modules along with features like Data fetching and Auto import makes it very popular among the developers.

Features of Nuxt.js:

  • Server-Side Rendering: The components can be easily rendered on the server before sending HTML to the client
  • On-demand rendering: The developer can decide at what level they want the component to be rendered and decide the best strategy to build a web application.
  • SEO friendly: Applications created by Nuxt.JS are ranked well on the search engines ad it optimizes the content while keeping the quality of the website so the end-user experience not compromised.
  • Flexible: The flexibility to choose between SSR and SSG makes the development process faster.
  • File System Routing: The ability to automatically route and code splitting helps in the creation of static webpages which can also be modified to create dynamic routes
  • Easy Transitions: Nuxt.js has an inbuilt <transition> element where animations and transitions can be easily handled.

Prerequisites: Before learning Nuxt.js a user should have basic knowledge of HTML, CSS, JavaScript, and Vue.js. After that the user should know about Node.js and a basic knowledge of NPM(Node Package Manager) is required.

 

 

Nuxt.js installation:

Step 1: In the terminal of your computer or VS code terminal type the following command to create a project

npx nuxi init projectName

Step 2: Navigate to the project folder

cd projectName

Step 3: Install the dependencies by typing the following command

npm install

 

Project Structure:

 

Example: In this example, we will create a basic page. Write this code in app.vue file.

Javascript




<template>
  <h1>GeeksforGeeks</h1>
  <div class="hello">
    Hello Nuxt Learners
  </div>
</template>
  
<style scoped>
h1 {
  color:green;
}
.hello {
  font-size: 1.5rem;
}
</style>

To run the code type the following command in the terminal:

npm run dev -- -o

Output:

Learn more about Nuxt JS:

Recent articles on Nuxt.js

Please write comments if you find anything incorrect, or if you want to share more information about the topic discussed above.


My Personal Notes arrow_drop_up
Last Updated : 15 Mar, 2023
Like Article
Save Article
Similar Reads
Related Tutorials