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
1 changed files with 1 additions and 1 deletions

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);
}
},
},