Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

136
Views
VUE JS 3 json data not rendering when using v-for

I've been trying to iterate over data inside of a json file and display it in a table. However nothing shows up. I was following a tutorial set by step, and redone it 6 times and it hasn't worked properly.

<div v-for="item in data" :key="item.id">
<p> {{item.SongName}} </p>
</div>
</template>

<script>
import JsonData from '../assets/learning/songs.json'
export default {
  data () {
    return {
      data: JsonData
   }
  }
 }
</script>

nothing shows up when I use {{item.Songname}} but when I use {{Data}} it shows all the data fine.

{
"Songs": [
{"id": 1, "SongName": "ກອດ | Pure - Tany Vannasin", "link": "https://youtu.be/bAzGST-gOsc"},
{"id": 2, "SongName": "ຕື່ນຈາກຝັນ - BAY6IX & LALA", "link": "https://youtu.be/L0YF-qzCyJc"},
{"id": 3, "SongName": "ແພງອ້າຍ - SOPHANA", "link": "https://youtu.be/D3H3ZAFsdF4"}
]
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You'll need to parse the imported JSON to turn it into a Javascript Object that Vue can understand.

<template>
    <div v-for="item in songs" :key="item.id">
        <p> {{item.SongName}} </p>
    </div>
</template>

<script>
import JsonData from '../assets/learning/songs.json'
export default {
    data() {
        return {
            songs: []
        }
    },
    mounted(){
        const parsedData = JSON.parse(JsonData);
        this.songs = parsedData.Songs
    }
}
</script>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!