Search icon CANCEL
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

Production measures


The first page we will make is the Measures page, where we will have two buttons:

  • The first one will generate a fake production measure with current date and random value
  • The second one will also generate a measure, but with the error property set to true

All these measures will be stored in a collection called "Measures".

Meteor collections integration

A Meteor collection is a reactive list of objects, similar to a MongoDB collection (in fact, it uses MongoDB under the hood).

We need to use a Vue plugin to integrate the Meteor collections into our Vue app in order to update it automatically:

  1. Add the vue-meteor-tracker npm package:
      meteor npm i -S vue-meteor-tracker
  1. Then, install the library into Vue:
      import VueMeteorTracker from 'vue-meteor-tracker'

Vue.use(VueMeteorTracker)
  1. Restart Meteor with the meteor command.

The app is now aware of the Meteor collection and we can use them in our components, as we will do in a moment.

Setting up data

The next step is setting up...

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