Reputation: 543
I have a loop component runned by a function to filter by inputs and selects. Can I get a reactive number of elements renderized by this filter?
<component-list class=""v-for="(item, index) in itemsFilters()" :key="index" :propId="item.id"
></component-list>
itemsFilter() returns a filter of an object array by selects and inputs. I have a pen with an example of this situation: https://codepen.io/joaosaro/pen/baXgjG
Upvotes: 2
Views: 3110
Reputation:
If itemsFilter is either computed or a method:
computed: {
itemsCount () {
// itemsFilters is computed
return this.itemsFilters.length
// or a method
return this.itemsFilters().length
}
}
Upvotes: 3