0👍
I’m not sure if I understood your question.
If you only want to show one element there why do you have a v-for?
You use v-for only if you want to show more than one element based on an array of strings/objects etc.
In any case, you can have a computed property and either filter out the objects you don’t want to render
For example if you have an array called solution):
data() {
return {
solutions: [
{ id: '0001' },
{ id: '0002' },
{ id: '0003' },
]
}
}
Then you can pick the item you want to render using computed:
computed: {
solution() {
return this.solutions[0]
}
}
By doing the above, you don’t need a v-for.
If you have more than one item to show then you can use again computed and filter out the items you don’t want to render.
- [Vuejs]-Vue.js axios delete request is deleting but table won't reset
- [Vuejs]-Trying to make equal height elements in Vue 3 / TypeScript / Quasar but it doesn't always work
Source:stackexchange.com