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
.
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
.
-
Why don't you create a puted variable out of
tableItems
that filters the items based on your search filter and pass the new variable to theitems
prop? – Thomas van Broekhoven Commented Oct 25, 2019 at 14:53
1 Answer
Reset to default 5Try 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
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742389206a4434674.html
评论列表(0条)