Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Vue.js 2 Web Development Projects

You're reading from   Vue.js 2 Web Development Projects Learn Vue.js by building 6 web apps

Arrow left icon
Product type Paperback
Published in Nov 2017
Publisher Packt
ISBN-13 9781787127463
Length 398 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
CHAU GUILLAUME CHAU GUILLAUME
Author Profile Icon CHAU GUILLAUME
CHAU GUILLAUME
Arrow right icon
View More author details
Toc

Google Auth and state management


In this first section, we will create our first Vuex store to help us manage the state of our application. We will use it to store the current user logging in through the Google OAuth API, which allows them to use their Google account to connect to our app.

Project setup

First, let's set up the basic structure of our new project. We will continue using the router and a few parts of Chapter 5, Project 3 - Support Center.

Creating the app

In this section, we will setup the base app structure for our Geolocated Blog.

  1. Like we did in Chapter 5, Project 3 - Support Center, we will initialize a Vue project with vue-init and install the babel, routing, and stylus packages:
      vue init webpack-simple geoblog</strong>
      cd geoblog
      npm install
      npm install --save vue-router babel-polyfill
      npm install --save-dev stylus stylus-loader babel-preset-vue

Note

Don't forget to add the "vue" preset in the .babelrc file.

  1. Then remove the content of the src...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image