I receive a response from a JSON API which contains the object locations
each location has the same key, label
. When I try to use a v-for
loop I am unable to print out more than one of the locations. What is going on?
Response from API call
"locations": [
{
"label": "Brighton",
"label": "London",
"label": "Manchester",
}
],
Template
<span v-for="(item, index) in locations" :key="index">
<span v-if="index != 0">, </span>
<span> {{ item.label }} </span>
</span>