Build a Server Rendered Vue.js App with Nuxt and Vuex

33 minutes

Vue.js has a first-class ecosystem to help construct Vue.js apps. This includes Nuxt.js which enables server-rendered applications and a page-based approach.

This course will start with an empty app and walk through how to use Vue.js for building the app, Nuxt.js for organizing the app, and Vuex for managing state.

pro-course-rss-logo

PRO RSS Feed

Setup a "Hello World" Server-Rendered Vue.js Application with the Vue-CLI and Nuxt

P

Manage Vue.js State with Vuex and Nuxt

P

Update Vuex State with Mutations and MapMutations in Vue.js

P

Add CSS Libraries to Nuxt

P

Add Arrays of Data to the Vuex Store and Display Them in Vue.js Templates

P

Load Data from APIs with Nuxt and Vuex

P

Understand the Flash of Unstyled Content in Nuxt

P

Handle Load Errors in Nuxt with Alternate Data, Redirect, or Error Layout

P

Navigate with nuxt-link and Customize isClient Behavior in Nuxt and Vue.js

P

Build a Vue.js Form then use Vuex Actions to Post to an API in Nuxt

P

Use Vuex Actions to Delete Data from APIs in Nuxt and Vue.js

P

Update State with Vuex Actions in Nuxt.js

P

Display Vuex Data Differently in Each Page of Nuxt and Vue.js

P
vue tutorial about Setup a "Hello World" Server-Rendered Vue.js Application with the Vue-CLI and Nuxt

Setup a "Hello World" Server-Rendered Vue.js Application with the Vue-CLI and Nuxt

2:21 vue PRO

The Vue-CLI helps you to quickly and easily setup new Vue projects. Nuxt.js is a library that helps you build server-rendered Vue.js applications. This lesson shows you how to use the nuxt/starter template with the Vue-CLI to quickly start a new project.

vue tutorial about Manage Vue.js State with Vuex and Nuxt

Manage Vue.js State with Vuex and Nuxt

2:03 vue PRO

Most applications require state to be shared across the application. In the case of Nuxt, you'll share state across pages. Nuxt integrates easily with Vuex by simply adding JavaScript files in the store directory. This lesson walks you through setting up a basic store and using it in your template

vue tutorial about Update Vuex State with Mutations and MapMutations in Vue.js

Update Vuex State with Mutations and MapMutations in Vue.js

1:49 vue PRO

You commit changes to state in Vuex using defined mutations. You can easily access these state mutations in your template using mapMutations. This lesson shows you have to wire together your Vue.js template with your Vuex store using mutations and mapMutations.

vue tutorial about Add CSS Libraries to Nuxt

Add CSS Libraries to Nuxt

1:25 vue PRO

You can easily add CSS libraries to Nuxt using yarn or npm to install them, then simply adding them to the nuxt.config.js so they're included in each page. Then all the classes will be available for use in all of your templates. This lesson walks your through installing a library then adding it to your nuxt.config.js.

vue tutorial about Add Arrays of Data to the Vuex Store and Display Them in Vue.js Templates

Add Arrays of Data to the Vuex Store and Display Them in Vue.js Templates

1:33 vue PRO

You add array of todos to the store simply by adding them to the state defined in your store/index.js file. You can access the array of todos using mapState then loop through and display them with v-for. This lesson walks you through the process of setting up todos in Vuex and displaying them in your Vue.js template.

vue tutorial about Load Data from APIs with Nuxt and Vuex

Load Data from APIs with Nuxt and Vuex

2:16 vue PRO

Before each page loads, Nuxt supports pre-fetching data to render what you need on the server. This lesson walks you through using Nuxt's fetch to load data then save it in the Vuex store.

vue tutorial about Understand the Flash of Unstyled Content in Nuxt

Understand the Flash of Unstyled Content in Nuxt

0:52 vue PRO

You'll notice soon after working with Nuxt that you'll begin to see your styles flash in during each page load. This is due to the development mode of Nuxt where it injects the styles into the page after the initial page render. You can rest assured that when you use nuxt build, your styles will render before the page loads.

vue tutorial about Handle Load Errors in Nuxt with Alternate Data, Redirect, or Error Layout

Handle Load Errors in Nuxt with Alternate Data, Redirect, or Error Layout

3:50 vue PRO

In a server-rendered application, if you attempt to load data before the page renders and the data fails to load, your application will not run unless you handle the error properly. This lesson walks you through the options of handling load errors so that your users will always have a good experience.

vue tutorial about Navigate with nuxt-link and Customize isClient Behavior in Nuxt and Vue.js

Navigate with nuxt-link and Customize isClient Behavior in Nuxt and Vue.js

2:56 vue PRO

Because Nuxt renders pages on the server, you should use the nuxt-link components to navigate between pages. Each time a page loads, you can check if you're on the client or server and avoid doing unnecessary loading based on how the page was rendered. This lesson walks you through using nuxt-link and isClient to navigate and avoid reloading data.

vue tutorial about Build a Vue.js Form then use Vuex Actions to Post to an API in Nuxt

Build a Vue.js Form then use Vuex Actions to Post to an API in Nuxt

5:25 vue PRO

The default behavior of submitting an HTML form is to reload the page. You can use the Vue.js @submit.prevent syntax to avoid that behavior. Then wire together the @submit event with an add Vuex action to handle an async post to an api. This lesson walks you through posting to an API using Vue.js, Vuex. and Nuxt.

vue tutorial about Use Vuex Actions to Delete Data from APIs in Nuxt and Vue.js

Use Vuex Actions to Delete Data from APIs in Nuxt and Vue.js

3:41 vue PRO

You'll begin to notice as you build out your actions in Vuex, many of them will look quite similar. Creating a remove action looks almost the same as the add action except for using the axios.delete method then filtering out the deleted todo once the response comes back.

vue tutorial about Update State with Vuex Actions in Nuxt.js

Update State with Vuex Actions in Nuxt.js

2:34 vue PRO

You can conditionally add classes to Vue.js templates using v-bind:class. This will help display the status of a todo as you add a Vuex action to patch todos. This lesson walks you through setting up a toggle button that triggers a toggle action to patch todos in Vuex.

vue tutorial about Display Vuex Data Differently in Each Page of Nuxt and Vue.js

Display Vuex Data Differently in Each Page of Nuxt and Vue.js

2:55 vue PRO

You often use the same data in different ways across pages. This lesson walks you through setting up multiple pages, retrieving the same data, then displaying it for each page's use-case.

Presented by:

John Lindquist

John Lindquist is a co-founder of egghead.io

John has spent the majority of his career developing Rich Web Applications. Before starting egghead.io, John worked at JetBrains as a WebStorm evangelist, and before that he was a Technical Architect at Isobar leading large teams in building the latest and greatest in web apps for the Air Force, HBO, and Bloomberg.

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?