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
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Vue.js 2

You're reading from   Learning Vue.js 2 Learn how to build amazing reactive web applications easily with Vue.js

Arrow left icon
Product type Paperback
Published in Dec 2016
Publisher Packt
ISBN-13 9781786469946
Length 334 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Olga Filipova Olga Filipova
Author Profile Icon Olga Filipova
Olga Filipova
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Going Shopping with Vue.js FREE CHAPTER 2. Fundamentals ā€“ Installing and Using 3. Components ā€“ Understanding and Using 4. Reactivity ā€“ Binding Data to Your Application 5. Vuex ā€“ Managing State in Your Application 6. Plugins ā€“ Building Your House with Your Own Bricks 7. Testing ā€“ Time to Test What We Have Done So Far! 8. Deploying ā€“ Time to Go Live! 9. What Is Next? A. Solutions to Exercises

Rewriting our shopping list application with single-file components


Now that we already know so much about components and how to use them, and also know nice techniques to make our code easier to write, let's get back to our shopping list and rewrite it as single-file component's Vue application. To have an easy setup, we can use vue-cli with Webpack configuration. Actually, we've already done it inĀ Chapter 2, Fundamentals - Installing and Using. So, just find this application and be prepared to start working on it. If you cannot find it, you can easily create it:

#install vue-cli if you still hadn't installed it 
$ npm install vue-cli -g 
#bootstrap the application 
$ vue init webpack shopping-list 
$ cd shopping-list 
$ npm install 
$ npm run dev 

Ensure that your index.html file looks like the following:

<!DOCTYPE html> 
<html> 
  <head> 
    <meta charset="utf-8"> 
    <title>shopping-list</title...
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