There is an object that has some properties, one of them is the 'average' value, and that object is ordered by that value from the backend, so if we reach that object with Postman, it is shown how it should be:
ranking: {
"5": {
"name": "Name5",
"average": "65"
},
"2": {
"name": "Name2",
"average": "59"
},
"4": {
"name": "Name4",
"average": "65"
},
"3": {
"name": "Name3",
"average": "65"
},
"1": {
"name": "Name1",
"average": "65"
},
}
The problem is that when a v-for is used, it renders based on the index (1,2,3,4,5), but it is needed to be rendered as it comes from the API call.
It is there any way to render
This is the v-for code (in the real object there is a field called id_sharp that corresponds to their personal identifications):
<div v-for="(persona, index) in ranking" :key="persona.id_sharp">
{{ persona.name }} -- {{ persona.average }}
</div>