[Vuejs]-How to get index in pagination vuejs?

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
}

0๐Ÿ‘

Fastest way:

{{number + offset + 1}} - {{item.name}}

Leave a comment