M
M
Muslim Yakhyaev2020-11-13 11:23:13
Vue.js
Muslim Yakhyaev, 2020-11-13 11:23:13

Vuejs how to access a specific object inside an array?

Good afternoon)
Please tell me how to refer to a specific object inside an array using v-for?

(5) [{…}, {…}, {…}, {…}, {…}]
0: {…}
1: {…}
2: {…}
3: {…}
4: {…}


<div v-for="item in advertisements" :key="item"> 
        {{item.photoPath}}
</div>


I iterated over the array in this way, but I get five elements) and I need to display one value)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korotenko, 2020-11-13
@firedragon

Why use a loop when you can just write square brackets?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question