O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Vue JS 2 - The Complete Guide (incl. Vue Router and Vuex)

Video Description

Vue JS is an awesome JavaScript framework for building frontend applications! VueJS mixes the best of Angular and React!

About This Video

You'll learn in this Course:-

  • What is VueJS and why would you use it?
  • Setting up a development environment and workflow
  • The basics (including the basic syntax, understanding templates and much more!)
  • Interacting with DOM (rendering lists, conditionally attaching/ detaching elements ...)
  • Using components (and what components are, to begin with)
  • Binding to form inputs
  • All about directives, filters, and mixins
  • How to make your app more beautiful with animations and transitions
  • How to create an awesome single-page-applications (SPA) with routing
  • How to improve state management by using Vuex
  • How to deploy the app

In Detail

Whichever metric you look at (Google Trends, Github Stars, Tweets ...) VueJS is the shooting star in the world of JavaScript frameworks - it simply is amazing! Frontend frameworks are extremely popular because they give us this reactive, great user experience we know from mobile apps, but now in the browser! No wonder that jobs requiring frontend framework skills like VueJS are amongst the best-paid ones in the industry! You may know Angular 2 and ReactJS, well, VueJS combines the best of both frameworks and makes building anything from small widgets to big, enterprise-level apps a breeze and a whole lot of fun! And if you don't know the two mentioned frameworks: That's fine, too, this course does not expect any knowledge of any other frontend framework - you will learn it all throughout this course! This course covers it all! We'll start at the very basics, what Vue.js is and how it works before we move on to more complex and advanced topics. And all this is accompanied with many exercises and multip

Table of Contents

  1. Chapter 1 : Getting Started
    1. Course Introduction 00:03:09
    2. Let's Create our First VueJS Application 00:04:45
    3. Extending the VueJS Application 00:04:12
    4. Course Structure 00:03:44
    5. Take Advantage of all Course Resources! 00:01:56
    6. Setup VueJS Locally 00:02:03
  2. Chapter 2 : Using VueJS to Interact with the DOM
    1. Module Introduction 00:00:45
    2. Understanding VueJS Templates 00:02:35
    3. How the VueJS Template Syntax and Instance Work Together 00:02:42
    4. Accessing Data in the Vue Instance 00:01:50
    5. Binding to Attributes 00:02:43
    6. Understanding and Using Directives 00:01:28
    7. Disable Re-Rendering with v-once 00:01:41
    8. How to Output Raw HTML 00:02:44
    9. Listening to Events 00:01:51
    10. Getting Event Data from the Event Object 00:02:36
    11. Passing your own Arguments with Events 00:01:53
    12. Modifying an Event - with Event Modifiers 00:03:24
    13. Listening to Keyboard Events 00:02:04
    14. Writing JavaScript Code in the Templates 00:03:19
    15. Using Two-Way-Binding 00:01:49
    16. Writing JavaScript Code in the Templates 00:09:32
    17. Reacting to Changes with Computed Properties 00:03:53
    18. An Alternative to Computed Properties: Watching for Changes 00:01:26
    19. Saving Time with Shorthands 00:04:23
    20. Dynamic Styling with CSS Classes – Basics 00:01:36
    21. Dynamic Styling with CSS Classes - Using Objects 00:03:28
    22. Dynamic Styling with CSS Classes - Using Names Setting Styles Dynamically (without CSS Classes) 00:03:16
    23. Styling Elements with the Array Syntax 00:01:14
    24. Module Wrap Up 00:00:45
  3. Chapter 3 : Using Conditionals and Rendering Lists
    1. Module Introduction 00:00:49
    2. Conditional Rendering with v-if 00:03:38
    3. Using an Alternative v-if Syntax 00:01:37
    4. Don't detach it with v-show 00:01:43
    5. Rendering Lists with v-for 00:02:26
    6. Getting the Current Index 00:01:51
    7. Using an Alternative v-for Syntax 00:01:11
    8. Looping through Objects 00:04:44
    9. Looping through a List of Numbers 00:00:57
    10. Keeping Track of Elements when using v-for 00:04:08
    11. Module Wrap Up 00:00:52
  4. Chapter 4 : First Course Project - The Monster Slayer
    1. Introduction & Challenge 00:02:54
    2. Setting up the Course Project 00:02:38
    3. Creating the Vue Instance and Styling the Healthbars 00:05:17
    4. Showing the Player Controls Conditionally 00:02:02
    5. Implementing a "Start Game" Method 00:01:53
    6. Implementing a "Attack" Method 00:08:03
    7. Write better Code - Time for Refactoring! 00:04:53
    8. Implementing a "Special Attack" 00:02:12
    9. Implementing a "Heal" Method 00:02:21
    10. Finishing the Action Buttons 00:00:59
    11. Creating an Action Log 00:02:41
    12. Printing the Log (v-for) 00:02:20
    13. Finishing the Log 00:01:57
    14. Styling the Log Conditionally 00:01:44
    15. Wrap Up 00:01:29
  5. Chapter 5 : Understanding the VueJS Instance
    1. Module Introduction 00:01:04
    2. Some Basics about the VueJS Instance 00:02:58
    3. Using Multiple Vue Instances 00:02:52
    4. Accessing the Vue Instance from Outside 00:03:30
    5. How VueJS manages your Data and Methods 00:04:02
    6. A r Look at $el and $data 00:04:55
    7. Placing $refs and Using them on your Templates 00:05:48
    8. Where to learn more about the Vue API 00:00:58
    9. Mounting a Template 00:06:43
    10. Using Components 00:04:57
    11. Limitations of some Templates 00:02:35
    12. How VueJS Updates the DOM 00:03:25
    13. The VueJS Instance Lifecycle 00:03:12
    14. The VueJS Instance Lifecycle in Practice 00:05:39
    15. Module Wrap Up 00:00:55
  6. Chapter 6 : Moving to a "Real" Development Workflow with Webpack and Vue CLI
    1. Module Introduction 00:01:34
    2. Why do we need a Development Server? 00:02:47
    3. What does "Development Workflow" mean? 00:03:51
    4. Using the Vue CLI to create Projects 00:02:35
    5. Installing the Vue CLI and creating a new Project 00:04:18
    6. An Overview over the Webpack Template Folder Structure 00:03:40
    7. Understanding ".vue" Files 00:06:46
    8. Understanding the Object in the Vue File 00:01:11
    9. How to Build your App for Production 00:00:50
    10. Module Wrap Up 00:01:11
  7. Chapter 7 : An Introduction to Components
    1. Module Introduction 00:01:05
    2. An Introduction to Components 00:04:56
    3. Storing Data in Components with the Data Method 00:04:04
    4. Registering Components Locally and Globally 00:02:50
    5. The "Root Component" in the App.vue File 00:03:22
    6. Creating a Component 00:04:25
    7. Using Components 00:05:33
    8. Moving to a Better Folder Structure 00:02:43
    9. How to Name your Component Tags (Selectors) 00:04:31
    10. Scoping Component Styles 00:05:05
    11. Module Wrap Up 00:00:51
  8. Chapter 8 : Communicating between Components
    1. Module Introduction 00:00:46
    2. Communication Problems 00:02:53
    3. Using Props for Parent => Child Communication 00:03:10
    4. Naming "props" 00:01:10
    5. Using "props" in the Child Component 00:01:28
    6. Validating "props" 00:04:57
    7. Using Custom Events for Child => Parent Communication 00:05:55
    8. Understanding Unidirectional Data Flow 00:01:07
    9. Communicating with Callback Functions 00:02:23
    10. Communication between Sibling Components 00:06:25
    11. Using an Event Bus for Communication 00:05:32
    12. Centralizing Code in an Event Bus 00:02:15
    13. Wrap Up 00:00:41
  9. Chapter 9 : Advanced Component Usage
    1. Module Introduction 00:00:38
    2. Setting up the Module Project 00:03:01
    3. Passing Content - The Suboptimal Solution 00:02:19
    4. Passing Content with Slots 00:00:43
    5. How Slot Content gets Compiled and Styled 00:03:03
    6. Using Multiple Slots (Named Slots) 00:02:50
    7. Default Slots and Slot Defaults 00:02:01
    8. A Summary on Slots 00:00:45
    9. Switching Multiple Components with Dynamic Components 00:05:31
    10. Understanding Dynamic Component Behavior 00:02:07
    11. Keeping Dynamic Components Alive 00:00:59
    12. Dynamic Component Lifecycle Hooks 00:01:18
    13. Wrap Up 00:01:11
  10. Chapter 10 : Second Course Project - Wonderful Quotes
    1. Module Introduction 00:01:36
    2. Setting up the Project 00:01:22
    3. Initializing the Application 00:01:28
    4. Creating the Application Components 00:04:04
    5. Passing Data with Props and Slots 00:02:13
    6. Allowing Users to Create Quotes with a NewQuote Component 00:04:08
    7. Adding Quotes with Custom Events 00:03:34
    8. Adding a Info Box 00:01:06
    9. Allowing for Quote Deletion 00:03:40
    10. Controlling Quotes with a Progress Bar 00:03:52
    11. Finishing Touches and State Management 00:02:13
  11. Chapter 11 : Handling User Input with Forms
    1. Module Introduction 00:00:54
    2. A Basic <input> Form Binding 00:03:46
    3. Grouping Data and Pre-Populating Inputs 00:02:42
    4. Modifying User Input with Input Modifiers 00:02:59
    5. Binding <textarea> and Saving Line Breaks 00:02:53
    6. Using Checkboxes and Saving Data in Arrays 00:04:05
    7. Using Radio Buttons 00:02:31
    8. Handling Dropdowns with <select> and <option> 00:05:10
    9. What v-model does and How to Create a Custom Control 00:02:50
    10. Creating a Custom Control (Input) 00:05:13
    11. Submitting a Form 00:02:08
    12. Wrap Up 00:00:43
  12. Chapter 12 : Using and Creating Directives
    1. Module Introduction 00:00:53
    2. Understanding Directives 00:03:34
    3. How Directives Work - Hook Functions 00:02:28
    4. Creating a Simple Directive 00:01:22
    5. Passing Values to Custom Directives 00:01:09
    6. Passing Arguments to Custom Directives 00:02:40
    7. Modifying a Custom Directive with Modifiers 00:02:25
    8. Custom Directives - A Summary 00:00:29
    9. Registering Directives Locally 00:01:37
    10. Using Multiple Modifiers 00:04:28
    11. Passing more Complex Values to Directives 00:02:13
    12. WrapUp 00:00:44
  13. Chapter 13 : Improving your App with Filters and Mixins
    1. Module Introduction 00:00:45
    2. Creating a Local Filter 00:04:32
    3. Global Filters and How to Chain Multiple Filters 00:01:45
    4. An (often-times better) Alternative to Filters: Computed Properties 00:05:15
    5. Understanding Mixins 00:02:23
    6. Creating and Using Mixins 00:02:25
    7. How Mixins get merged 00:02:58
    8. Creating a Global Mixin (Special Case!) 00:03:26
    9. Mixins and Scope 00:02:34
    10. Wrap Up 00:01:56
  14. Chapter 14 : Adding Animations and Transitions
    1. Module Introduction 00:01:08
    2. Understanding Transitions 00:01:01
    3. Preparing Code to use Transitions 00:03:11
    4. Setting Up a Transition 00:03:09
    5. Assigning CSS Classes for Transitions 00:02:27
    6. Creating a "Fade" Transition with the CSS Transition Property 00:03:22
    7. Creating a "Slide" Transition with the CSS Animation Property 00:03:59
    8. Mixing Transition and Animation Properties 00:03:31
    9. Animating v-if and v-show 00:00:34
    10. Setting Up an Initial (on-load) Animation 00:01:30
    11. Using Different CSS Class Names 00:04:01
    12. Using Dynamic Names and Attributes 00:02:33
    13. Transitioning between Multiple Elements (Theory) 00:00:34
    14. Transitioning between Multiple Elements (Practice) 00:04:43
    15. Listening to Transition Event Hooks 00:02:06
    16. Understanding JavaScript Animations 00:08:03
    17. Excluding CSS from your Animation 00:01:28
    18. Creating an Animation in JavaScript 00:06:18
    19. Animating Dynamic Components 00:05:58
    20. Animating Lists with <transition-group> 00:00:44
    21. Using <transition-group> - Preparations 00:04:20
    22. Using <transition-group> to Animate a List 00:06:12
    23. Understanding the App 00:01:15
    24. Creating the App 00:12:04
    25. Adding Animations 00:06:38
    26. Wrap Up 00:01:03
  15. Chapter 15 : Connecting to Servers via Http - Using vue-resource
    1. Module Introduction 00:01:42
    2. Accessing Http via vue-resource – Setup 00:04:00
    3. Creating an Application and Setting Up a Server (Firebase) 00:05:24
    4. POSTing Data to a Server (Sending a POST Request) 00:06:10
    5. GETting and Transforming Data (Sending a GET Request) 00:06:55
    6. Configuring vue-resource globally 00:02:48
    7. Intercepting Requests 00:03:34
    8. Intercepting Responses 00:02:51
    9. Where the "resource" in vue-resource comes from 00:04:42
    10. Creating Custom Resources 00:02:39
    11. Resources vs "Normal" Http Requests 00:00:28
    12. Understanding Template URLs 00:05:06
    13. Wrap Up 00:01:42
  16. Chapter 16 : Routing in a VueJS Application
    1. Module Introduction 00:01:38
    2. Setting up the VueJS Router (vue-router) 00:02:16
    3. Setting Up and Loading Routes 00:06:44
    4. Understanding Routing Modes (Hash vs History) 00:04:15
    5. Navigating with Router Links 00:03:45
    6. Where am I? - Styling Active Links 00:03:20
    7. Navigating from Code (Imperative Navigation) 00:02:42
    8. Setting Up Route Parameters 00:01:59
    9. Fetching and Using Route Parameters 00:02:03
    10. Reacting to Changes in Route Parameters 00:03:05
    11. Setting Up Child Routes (Nested Routes) 00:04:40
    12. Navigating to Nested Routes 00:03:09
    13. Making Router Links more Dynamic 00:02:04
    14. A Better Way of Creating Links - With Named Routes 00:03:21
    15. Using Query Parameters 00:02:54
    16. Multiple Router Views (Named Router Views) 00:03:28
    17. Redirecting 00:02:13
    18. Setting Up "Catch All" Routes / Wildcards 00:01:06
    19. Animating Route Transitions 00:02:35
    20. Passing the Hash Fragment 00:03:28
    21. Controlling the Scroll Behavior 00:03:22
    22. Protecting Routes with Guards 00:01:13
    23. Using the "beforeEnter" Guard 00:07:51
    24. Using the "beforeLeave" Guard 00:03:31
    25. Loading Routes Lazily 00:07:08
    26. Wrap Up 00:01:03
  17. Chapter 17 : Better State Management with Vuex
    1. Module Introduction 00:01:12
    2. Why a Different State Management May Be Needed 00:02:25
    3. Understanding "Centralized State" 00:01:32
    4. Using the Centralized State 00:06:50
    5. Why a Centralized State Alone Won't Fix It 00:02:41
    6. Understanding Getters 00:00:48
    7. Using Getters 00:02:40
    8. Mapping Getters to Properties 00:06:57
    9. Understanding Mutations 00:01:15
    10. Using Mutations 00:04:51
    11. Why Mutations have to run synchronously 00:01:35
    12. How Actions improve Mutations 00:01:33
    13. Using Actions 00:05:00
    14. Mapping Actions to Methods 00:04:58
    15. A Summary of Vuex 00:04:14
    16. Two-Way-Binding (v-model) and Vuex 00:05:56
    17. Improving Folder Structures 00:01:01
    18. Modularizing the State Management 00:04:56
    19. Using Separate Files 00:04:18
    20. Using Namespaces to Avoid Naming Problems 00:06:44
    21. Wrap Up 00:00:51
  18. Chapter 18 : Final Project - The Stock Trader
    1. Project Introduction 00:03:11
    2. Project Setup and Planning 00:02:45
    3. Creating the First Components 00:02:56
    4. Setup Project Routes 00:04:42
    5. Adding a Header and Navigation 00:06:44
    6. Planning the Next Steps 00:01:22
    7. Creating Stocks Components 00:06:31
    8. Adding a "Buy" Button 00:05:57
    9. Setting up the Vuex State Management 00:10:21
    10. Adding a Portfolio Module to Vuex 00:10:02
    11. Working on the Portfolio Stocks 00:06:51
    12. Connecting the Portfolio with Vuex 00:02:21
    13. Time to fix some Errors 00:02:00
    14. Displaying the Funds 00:03:41
    15. Adding some Order Checks 00:05:41
    16. Making Funds Look Nicer with Filters 00:01:48
    17. Ending the Day - Randomizing Stocks 00:05:30
    18. Animating the Route Transitions 00:03:14
    19. Saving & Fetching Data - Adding a Dropdown 00:02:18
    20. Setting up vue-resource and Firebase 00:02:16
    21. Saving Data (PUT Request) 00:02:51
    22. Fetching Data (GET Request) 00:05:04
    23. Testing and Bug Fixes 00:02:50
    24. Project Wrap Up 00:01:22
    25. Bonus: Debugging Vuex with Vue Developer Tools 00:01:59
  19. Chapter 19 : Deploying a VueJS Application
    1. Module Introduction 00:01:13
    2. Preparing for Deployment 00:01:45
    3. Deploying the App (Example: AWS S3) 00:05:58
  20. Chapter 20 : Course Roundup
    1. Courses Roundup 00:00:59
  21. Chapter 21 : All Course Exercises ("Time to Practice")
    1. Time to Practice (1) - Outputting Data to Templates (Problem) 00:01:59
    2. Time to Practice (1) - Outputting Data to Templates (Solution) 00:06:12
    3. Time to Practice (2) - Events (Problem) 00:01:43
    4. Time to Practice (2) - Events (Solution) 00:04:54
    5. Time to Practice (3) - Reactive Properties (Problem) 00:02:29
    6. Time to Practice (3) - Reactive Properties (Solution) 00:05:47
    7. Time to Practice (4) - Styling (Problem) 00:03:49
    8. Time to Practice (4) - Styling (Solution) 00:18:17
    9. Time to Practice (5) - Conditionals and Lists (Problem) 00:01:40
    10. Time to Practice (5) - Conditionals and Lists (Solution) 00:09:39
    11. Time to Practice (6) - Components (Problem) 00:01:45
    12. Time to Practice (6) - Components (Solution) 00:02:13
    13. Time to Practice (7) - Component Communication (Problem) 00:03:07
    14. Time to Practice (7) - Component Communication (Solution) 00:10:17
    15. Time to Practice (8) - Slots and Dynamic Components (Problem) 00:01:28
    16. Time to Practice (8) - Slots and Dynamic Components (Solution) 00:03:01
    17. Time to Practice (9) - Forms (Problem) 00:01:30
    18. Time to Practice (9) - Forms (Solution) 00:15:17
    19. Time to Practice (10) - Directives (Problem) 00:00:55
    20. Time to Practice (10) - Directives (Solution) 00:05:55
    21. Time to Practice (11) - Filters and Mixins (Problem) 00:01:08
    22. Time to Practice (11) - Filters and Mixins (Solution) 00:08:12
  22. Chapter 22 : Bonus: Using Axios instead of vue-resource
    1. About this Section 00:00:37
    2. Module Introduction 00:01:07
    3. Project Setup 00:02:46
    4. Axios Setup 00:02:12
    5. Sending a POST Request 00:05:40
    6. Sending a GET Request 00:02:53
    7. Accessing & Using Response Data 00:05:48
    8. Setting a Global Request Configuration 00:05:43
    9. Using Interceptors 00:05:50
    10. Custom Axios Instances 00:04:57
    11. Wrap Up 00:00:59
  23. Chapter 23 : Bonus: Authentication in Vue Apps
    1. About this Section 00:00:52
    2. Module Introduction 00:02:00
    3. How Authentication Works in SPAs 00:03:11
    4. Project Setup 00:02:36
    5. Adding User Signup 00:05:14
    6. Adding User Signin (Login) 00:02:41
    7. Using Vuex to send Auth Requests 00:04:27
    8. Storing Auth Data in Vuex 00:03:45
    9. Accessing other Resources from Vuex 00:08:41
    10. Sending the Token to the Backend 00:05:38
    11. Protecting Routes (Auth Guard) 00:02:49
    12. Updating the UI State (based on Authentication State) 00:03:01
    13. Adding User Logout 00:05:01
    14. Adding Auto Logout 00:05:36
    15. Adding Auto Login 00:10:37
    16. Wrap Up 00:01:02
  24. Chapter 24 : Bonus: Form Input Validation
    1. About this Section 00:00:57
    2. Module Introduction 00:01:05
    3. Installing Vuelidate 00:02:04
    4. Adding a Validator 00:10:14
    5. Adding Validation UI Feedback 00:04:56
    6. Controlling Styles for Invalid Entries 00:02:10
    7. More Validators 00:06:33
    8. Validating Passwords for Equality 00:06:16
    9. Using the Required-Unless Validator 00:04:52
    10. Validating Arrays 00:07:20
    11. Controlling the Form Submit Button 00:02:12
    12. Creating Custom Validators 00:02:46
    13. Async Validators 00:09:16
    14. Wrap Up 00:01:05
  25. Chapter 25 : Bonus: Vue CLI 3
    1. Module Introduction 00:03:19
    2. Creating a Project 00:04:42
    3. Analyzing the Created Project 00:04:49
    4. Using Plugins 00:04:05
    5. CSS Pre-Processors 00:03:15
    6. Environment Variables 00:07:28
    7. Building the Project 00:03:43
    8. Instant Prototyping 00:02:40
    9. Different Build Targets 00:08:40
    10. Using the "Old" CLI Templates (vue init) 00:01:19
    11. Using the Graphical User Interface (GUI) 00:05:05