I have a dataset that includes multiple languages and their corresponding pages.
export const myData = [
{
id: 1,
lang: "it",
items: [
{
id: 1,
title: "IT Page1",
},
{
id: 2,
title: "IT Page2",
},
{
id: 3,
title: "IT Page3",
}
]
},
{
id: 2,
lang: "en",
items: [
{
id: 1,
title: "EN Page1",
},
{
id: 2,
title: "EN Page2",
},
{
id: 3,
title: "EN Page3",
}
]
}
]
Currently, the loop I'm using only outputs specific titles from the data:
<ul v-for="(item, i) in myData" :key="i">
<li>{{ item.items[i].title }}</li>
</ul>
However, I want the loop to display all data for both languages. Additionally, I need to figure out how to choose a language either statically or dynamically. Can you help me with this?