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 randomvalue
- The second one will also generate a measure, but with the
error
property set totrue
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:
- Add the
vue-meteor-tracker
npm package:
meteor npm i -S vue-meteor-tracker
- Then, install the library into Vue:
import VueMeteorTracker from 'vue-meteor-tracker'
Vue.use(VueMeteorTracker)
- 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...