Can anyone help me figure out how to work through this JSON data using VUE? I'm having trouble accessing keys that v-for can't seem to reach:
[
{
"Lavandería": {
"id": 1,
"name": "Lavandería",
"img": "rinse.png",
"Servicios": [
{"model":"Sentra", "doors":4},
{"model":"Maxima", "doors":4},
{"model":"Skyline", "doors":2}
]
},
"Tintorería": {
"id": 2,
"name": "Tintorería",
"img": "shirt-2.png",
"Servicios": [
{"model":"Sentra", "doors":4},
{"model":"Maxima", "doors":4},
{"model":"Skyline", "doors":2}
]
},
"Planchado": {
"id": 3,
"name": "Planchado",
"img": "iron.png",
"Servicios": [
{"model":"Sentra", "doors":4},
{"model":"Maxima", "doors":4},
{"model":"Skyline", "doors":2}
]
},
"Otros": {
"id": 4,
"name": "Otros",
"img": "wring.png",
"Servicios": [
{"model":"Sentra", "doors":4},
{"model":"Maxima", "doors":4},
{"model":"Skyline", "doors":2}
]
}
}
]
I need to extract the id and image of each item first, in order to access their respective "Services" data.
My attempt with v-for looks like this:
v-for="item in services" :key="item.id"
However, I am unable to even retrieve the IDs. When I console.log it as follows, I see the data but still struggle with implementing it in VUE: console.log(this.services[0].Lavandería.id);