[Vuejs]-How to generate row numbers (1, 2, 3, …) when bind the custom table to array?

0👍

you can add index in the same way as item in template.

<template slot="rows" slot-scope="{ item: booking,index:index }">
  <tr>
    <td>{{ index }}</td>
    <td></td>
    <td></td>
    <td>{{ fullName(booking.user) }}</td>
    <td>{{ unitName(booking.search_by) }}</td>
    ...
  </tr>
</template>

Leave a comment