I have an array of servers, which I display in the template using v-for. Using the vue-nats library, I subscribe each server to receive dynamic data.
methods: {
subscribe(uuid) {
this.$nats.subscribe('report.' + uuid, (msg) => {
this.serversDetailedInfo = Object.assign({}, this.serversDetailedInfo, msg)
})
}
}
The data comes in and I put it in the object: serversDetailedInfo. In msg I get objects:
Object { server_uuid: "OTgxYWZlNDctMWE4Zi", ram: {…}, hdd: {…}, tstamp: "" }
Object { server_uuid: "ZjhlNDY2MjQtYjRiZi", ram: {…}, hdd: {…}, tstamp: "" }
But when I display this data in the template, I get not a list of data for each server, but only data for one server - new data overwrites old data. How I can dispaly data in template for each server? Thank you inadvance.