I'm getting an object of objects from Firebase, but need to change the default items order. For that, I use Lodash orderBy()
method.
computed: {
sortedLogs() {
return orderBy(this.logs, 'date', 'desc')
}
},
The problem now is this method remove objects keys, and I need these keys to manage item delete request.
Original
{
MFVMHJHnbpr: {
date: 1598270895
side: 'l'
},
MFVMblsdfdPb: {
date: 1598270825
side: 'r'
},
MsxvblsdfdPb: {
date: 1598271225
side: 'l'
},
}
After orderBy()
{
0: {
date: 1598270895
side: 'l'
},
1: {
date: 1598270825
side: 'r'
},
2: {
date: 1598271225
side: 'l'
},
}
this.logs
? An SO question should always contain a detailed description of the problem: What do you want to achieve (output) on the basis of which input?