Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
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 (18) Chapters Close

Learning Vue.js 2
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Dedication
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? 10. Solutions to Exercises

Rewriting the Pomodoro application with single-file components


I hope you still remember and possibly even use the Pomodoro application that we developed in the first chapter of this book.

I would like to revisit it now and to do the same exercise we did in the previous section—define the components of the application and rewrite it using these components.

Let's have a look at our Pomodoro application. And now I am going to spoil you: I'll include a screenshot that already contains the kittens that are being shown during the resting time using http://thecatapi.com/api:

The Pomodoro application in its Rest! state

There are some easily identifiable components:

  • The component of the controls (start, pause, end), let's name it ControlsComponent
  • The component of the time countdown, CowntdownComponent
  • The component of the title of the current state (Work!/Rest!), StateTitleComponent
  • The component of the kittens rendering that depends on the state (working or resting), KittensComponent (this...
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 $15.99/month. Cancel anytime
Visually different images