Book Image

Vue.js 2 Web Development Projects

By : CHAU GUILLAUME
Book Image

Vue.js 2 Web Development Projects

By: CHAU GUILLAUME

Overview of this book

Do you want to make your web application amazingly responsive? Are you unhappy with your app's performance and looking forward to trying out ways to make your app more powerful? Then Vue.js, a framework for building user interfaces, is a great choice, and this book is the ideal way to put it through its paces. This book's project-based approach will get you to build six stunning applications from scratch and gain valuable insights in Vue.js 2.5. You'll start by learning the basics of Vue.js and create your first web app using directives along with rich and attractive user experiences. You will learn about animations and interactivity by creating a browser-based game. Using the available tools and preprocessor, you will learn how to create multi-page apps with plugins. You will create highly efficient and performant functional components for your app. Next, you will create your own online store and optimize it. Finally, you will integrate Vue.js with the real-time Meteor library and create a dashboard showing real-time data. By the end of this book you will have enough skills and will have worked through enough examples of real Vue.js projects to create interactive professional web applications with Vue.js 2.5.
Table of Contents (15 chapters)

General app structure


In this first part, we are going to create the project structure and learn more about routing and pages.

Setting up the project

For setting up the project, the following steps need to be followed:

  1. First, generate a Vue project with the vue init webpack-simple <folder> command, like we did in Chapter 4, Advanced Project Setup:
      vue init webpack-simple support-center
      cd support-center
      npm install
      npm install --save babel-polyfill
  1. Install the packages necessary to compile Stylus code (our style will be written using Stylus):
  • stylus
  • stylus-loader
      npm install --save-dev stylus stylus-loader

Note

Don't forget to save the development tools packages in the development dependencies of your package.json file with the --save-dev flag.

  1. Remove the content of the src folder where we will put all the sources of our app.
  2. Then create a main.js file with the code needed to create a Vue app:
      import 'babel-polyfill'
      import Vue from 'vue'

      new Vue...