[Vuejs]-Cant get value in Vue from data

0👍

If I understood You correctly , maybe like following snippet (can use v-for for object)

const app = Vue.createApp({
  data() {
    return {
      item: {
        "1": {
          "advertiser_id": "3184",
          "clicks": "27,577",
          "orders": "10,722",
          "earnings_per_click": "257.11",
        },
      }
    };
  },
})
app.mount('#demo')
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script>
<div id="demo">
  <div v-for="(val, key, i) in item['1']" :key="i">
    {{ key }} - {{ val }}
  </div>
</div>

Leave a comment