I'm doing a list of items by using a v-for and for each properties i'm trying to sort them by ascending and descending.
The fact is I trigger the sort function on a v-btn to sort by ascending but when i click again nothing happen. I would like to reverse the sort and etc. when I click again on it.
My current method for on of my property is :
sortByScope()
{
this.alerts.sort(function(a, b){
if(a.scope < b.scope){ return -1 }
if(a.scope > b.scope){ return 1 }
return 0
})
},
Do you have any ideas ?
Thanks for your attention