Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 140817

Render a date that comes asynchronous for each item in v-for

$
0
0

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.


Viewing all articles
Browse latest Browse all 140817

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>