Highlights
• Shares an idea from the Next.js
• Similar to Ember tries to pack essential set of tools
• UI rendering as main scope (abstracting away the
client/server distribution)
How it works?
Focus on writing
*.vue files
Code Splitting
with Webpack
ES6/ES7
transpilation
What’s in the box?
• Vue 2
• Vue-Router
• Vuex (included only when
using the store option)
• Vue-Meta
A total of only 28kb
min+gzip (31kb with Vuex)
Features
• Automatic Code Splitting
• Server-Side Rendering
• Powerful Routing System
with Asynchronous Data
• Static File Serving
• Bundling and minifying of
your JS & CSS
• Managing Head Elements
• Hot reloading in
Development
• Error handling (404 pages)
• Nuxt.js adds an asyncData() method to let
you handle async operations before setting
the component data.
• The result from asyncData will be merged
with data.
Async Data
• Returning a Promise.
• Using the async/await proposal
• Define a callback as second argument
Different ways to use asyncData
/assets folder is automatically processed
and resolved as module dependencies.
url('~assets/image.png')
becomes:
require('~assets/image.png')
Served Assets
Install via npm:
npm install --save axios
use it directly in our pages:
import axios from 'axios'
use build.vendor key in our nuxt.config.js:
build: { vendor: ['axios'] }
External packages