How to get the filtered array from Vuetify v-data-table?

Viewed 5151

This is how is my data table is

<v-data-table
 :search="search"
 :headers="tableHeaders"
 :items="tableItems"
 hide-default-footer
 ></v-data-table>

Is there any way to get the filtered items from data table after search filter is applied. I am passing array in :items which is being filtered by :search.

1 Answers

Try to add a handler to @current-items event like :

@current-items="getFiltered"

and add it to your methods as follows:

methods:{
  getFiltered(e){
   console.log(e) //output the filtered items
 }
}

check this codepen

Related