I get from my api json object list like that:
"object123": {
"selected": false,
"value": 0.54
},
In the frontend, I have table where I display this data with checkbox, how to sort this data by this select property? can you give me a small example?
I tried with
sortedData: function() {
if(this.calculated) {
return this.calculated.sort(function(a, b) {
return a.selected > b.selected
})
}
}
but then the table is empty.
calculated? Does it contain an object or an array?this.calculatedan array of objects?