I want to show only articles with id=1
in my VueJS view. Below is the code I have that currently displays all articles using v-for
:
<div v-for="exercise in exercises"
v-bind:key="exercise">
<h2>{{ exercise.name }}</h2>
</div>
Here are my data:
[
{
"id": "1",
"name": "Test1",
},
{
"id": "2",
"name": "Test2",
},
{
"id": "1",
"name": "Test3",
}
]
Is there a way to filter the data based on exercice[i].id
? Any help would be appreciated.
Thank you