Sure thing.
So computed properties are pretty much the best thing about Vue. Rather than setting "dumb" values like you used to, you specify values as functions in your computed property in your Vue / component definition. This is then converted into a JS getter, so later you just reference the property, but it runs a function to return a value:
myComponent.filteredItems; // does a calculation and returns a filtered list
So for your list, you're limited by the syntax you can write in an expression, so if you're hitting the limits of that, move the heavy lifting to a more explicit computed property:
computed:
{
filteredItems:function()
{
return this.items
.filter(function(item)
{
return item.someProp == 'some value'; // I don't know what your "searchInvoice" is, this is just dummy code
})
.filter(function(item)
{
return item.paid == 0 || item.paid == 1;
})
.slice(0, 20);
}
}
You can reference this from anywhere:
console.log(this.filteredItems);
Or set other values that affect it:
{
// previous filtering
return this.items.slice(this.currentPage, this.pageLength);
}
Make sense?