我的数据表是这样的
<v-data-table
:search="search"
:headers="tableHeaders"
:items="tableItems"
hide-default-footer
></v-data-table>
在应用搜索过滤器后,是否有任何方法可以从数据表中获取过滤的项目。我在 :items
中传递数组,它被 :search
过滤。
最佳答案
尝试向 @current-items
事件添加处理程序,例如:
@current-items="getFiltered"
并将其添加到您的方法中,如下所示:
methods:{
getFiltered(e){
console.log(e) //output the filtered items
}
}
检查这个codepen
关于javascript - 如何从 Vuetify v-data-table 中获取过滤后的数组?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58560725/