Vue.set to set metrics object, array assignment won't be picked up by Vue listeners

This commit is contained in:
Fabio Manganiello 2019-07-02 15:08:32 +02:00
parent e82edc8338
commit 9c44d047ac

View file

@ -53,7 +53,7 @@ Vue.component('sensors', {
onSensorEvent: function(event) {
const data = event.data;
for (const [name, value] of Object.entries(data)) {
this.metrics[name] = value;
Vue.set(this.metrics, name, value);
}
},
},