'How to get key json value in row click event in Vuejs?

I have a very specific question if anyone knows how to do that.

I am using a v-data-table component and fill the data with a json retrieved from backend with :items="Object.values(data)" since v-data-table items prop works with Array and not Object :

 <v-data-table
      :headers="headers"
      :items="Object.values(data)"
      :items-per-page="5"
      class="elevation-1 table row-pointer"
      @click:row="selectedRow"
      single-select
      :footer-props="{
        showFirstLastPage: true,
        firstIcon: 'mdi-arrow-collapse-left',
        lastIcon: 'mdi-arrow-collapse-right',
      }"
    ></v-data-table>

This works great however I want to retrieve in my selectedRow function the complete item with the keys and all and not just Object.values(data), how can I do that since I need an array in :items ? I can't use :items="data" because it's an Object.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source