0๐
I would suggest putting the output of each item into a child component and passing the index of that item in the array as a param. There are other ways to do it, such as passing the item from your vue template into a method and looking up the index of the field, eg:
// vue template
{{ whatIndex(item) }}
// vue js
vue.methods.whatIndex = function (item) {
// some logic to lookup the name from this.items
return i
}
- [Vuejs]-Importing services in Vue.js
- [Vuejs]-Modifying properties fetched with Apollo GraphQL in vueJs
0๐
Fastest way:
{{number + offset + 1}} - {{item.name}}
Source:stackexchange.com