Set metrics object through Vue.set

This commit is contained in:
Fabio Manganiello 2019-07-02 15:02:44 +02:00
parent be79d15faf
commit e82edc8338

View file

@ -41,13 +41,13 @@ Vue.component('sensors', {
});
});
this.metrics = (await Promise.all(promises)).reduce((obj, metrics) => {
Vue.set(this, 'metrics', (await Promise.all(promises)).reduce((obj, metrics) => {
for (const [name, value] of Object.entries(metrics)) {
obj[name] = value;
}
return obj;
}, {});
}, {}));
},
onSensorEvent: function(event) {