[Vuejs]-Using counter flag in v-for loop

0👍

If you want to count your objects, then just count your data. No need to involve DOM.

section.list is an array, so section.list.length should give you desired count.

Also, as mentioned in the answer before, use some unique property of item (for example some sort of id) as the value for :key attribute.

-1👍

You can’t do it like this, Vue.js is reactive framework and you should learn a little bit before asking these kind of questions – https://v2.vuejs.org/v2/guide/reactivity.html

Use your key as id instead

Leave a comment