I am strugling listing items with v-for on an associative array.
Don't know how to pass the key's of the array's and then list the titles.
Found a lot of examples, but didn't found a familiar example.
There are more language selections, but posted just a few so you could all get the idea.
Array:
data: () => ({
translations: [
{
'lt': {
title: 'Lithuanian',
},
'en': {
title: 'English',
}
}
],
})
HTML:
<select v-model="activeLanguage">
<option v-for="(translation, key) in translations" :value="key">
{{translation.title}}
</option>
</select>
How to specify the key and then display the titles in a v-for and in a HTML option tag?
translationsand edit it so it's an object and not an array?