Quote from the official site:
On October 25, 2016, the zeit.co team announced Next.js, a React application framework with server rendering. A few hours after this announcement, Nuxt.js was born - the embodiment of a similar idea for Vue.js.
Nuxt.js is a framework for creating universal applications on Vue.js using Node.js. With it, you can render the UI on the server and generate static sites.
It uses:
Create the first universal application in two ways:
1) Using a template from vue-cli
If not installed vue-cli then install
npm install -g vue-cli
Now we create a project using a pre-made template
vue init nuxt-community/starter-template
And run
npm run dev
2) Hands from scratch
Create a folder for the project and the file package.json
{ "name": "my-app", "scripts": { "dev": "nuxt" } }
Here we have indicated how we will launch the application. Next, install Nuxt.js itself.
npm install --save nuxt
After everything is established in the folder of our project, we create the pages folder. It will store our pages with a .vue extension. Once launched, Nuxt converts them all into application routes. Create index.vue
<template> <h1> Nuxt.js!</h1> </template>
As you can see, Nuxt uses the same templating as Vue. And now we will launch our application.
npm run dev
It is available at http: // localhost: 3000 /
Nuxt also has its own required folders and the nuxt.config.js configuration file . You can customize site headers, enable global CSS, enable caching, and more.
Folder List:
Official site
Russian-language guide and documentation (Translation is not complete)
Source: https://habr.com/ru/post/336902/
All Articles