The Wayback Machine - https://web.archive.org/web/20240717142737/https://www.geeksforgeeks.org/nuxtjs/
Open In App

NuxtJS

Last Updated : 01 May, 2023
Improve
Suggest changes
Post a comment
Like Article
Like
Save
Share
Report

Nuxt.js is a famous open-source framework for building Vue.js applications. It is based on Vue.js, which is one of the greatest frameworks for JavaScript similar to React.js used for building user interfaces. It provides a wide variety of features to developers for quickly creating and deploying server-side rendered (SSR) Vue.js applications.

Nuxt.js allows developers to create SEO-friendly websites with faster page load times and good performance. It has a large and active community that helps us with resources, plugins, and modules. Nuxt.js has many contributors and they are constantly upgrading its features.

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:

Let’s use the nuxi init CLI, and create our first Nuxt.js app.

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:

Folder 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



Similar Reads

How to Display Time in NuxtJS ?
In this article, we are going to learn how we can show time in 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. Approach: To show time in nuxtjs we are going to use the vue-time package. The vu
2 min read
How to add DatePicker in NuxtJS ?
In this article, we are going to learn how we can add a Datepicker in 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. Approach: To add our DatePicker we are going to use the vuejs-datepicker p
2 min read
NuxtJS Commands
In this article, we are going to learn about NuxtJS Commands that are present in the NuxtJS framework. It comes with some useful commands for development and production. All the Nuxtjs commands are described with the output images. Create NuxtJS Application: Step 1: You can create a new NuxtJs project using the below command: npx create-nuxt-app gf
2 min read
NuxtJS Deployment
In this article, we are going to learn how we can deploy our NuxtJS app on Vercel. 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. Nuxt gives you the ability to host your web application on vercel hos
2 min read
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 u
3 min read
Article Tags :
three90RightbarBannerImg