admin管理员组文章数量:1335386
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
本文标签: javascriptHow to get the filtered array from Vuetify vdatatableStack Overflow
版权声明:本文标题:javascript - How to get the filtered array from Vuetify v-data-table? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742389205a2465650.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论