Which index are you referring to? The current loop index of v-for?
<div v-for="(value, index) in items">
{{ index }}: {{ value }}<br />
</div>
See the documentation of VueJS; https://vuejs.org/guide/essentials/list.html#v-for
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
How to add index from v-for loop to attribute "someAttr"?
<input :someAttr=??? type="number" v-model="data" class="w-12 h-6 border rounded-lg appearance-none">
Please or to participate in this conversation.