protonemedia / inertiajs-tables-laravel-query-builder

Inertia.js Tables for Laravel Query Builder
https://protone.media/en/blog/introducing-inertiajs-tables-a-datatables-like-package-for-laravel-query-builder
MIT License
438 stars 123 forks source link

Feature Enhancement - Access row index on cell slot #73

Open caturandi-labs opened 2 years ago

caturandi-labs commented 2 years ago

Hi @pascalbaljet , I have some issue when accessing row index on cell slot. I suggest you to add slot props (index). My reason is I want to process the index in table.

Please refer to this code: https://github.com/protonemedia/inertiajs-tables-laravel-query-builder/blob/main/js/Components/Table.vue

please check line code 159, can you add this code :index="key" ?

<slot
      :name="`cell(${column.key})`"
      :item="item"
      :index="key"
    >
      {{ item[column.key] }}
</slot>