I would like the years to still be displayed desc order. In my request, the years and correctly sorted.
My PHP controller returns a json like this:
{
"2018":[
{
"id":25071,
},
{
"id":35037,
}
],
"2017":[
{
"id":20449,
},
{
"id":25797
}
],
"2016":[
{
"id":20419,
},
{
"id":25778
}
]
}
But when I get in in my vue component
getYears: function(){
axios.get('/blablabla/').then(
response => {
console.log(response.data);
this.years=response.data;
}
);
}
I get this result
{2008: Array(1), 2010: Array(5), 2011: Array(7), 2012: Array(7), 2013: Array(4), 2014: Array(5), 2015: Array(8), 2016: Array(4), 2017: Array(6), 2018: Array(6)} 2008: (...) 2010: (...) 2011: (...) 2012: (...) 2013: (...) 2014: (...) 2015: (...) 2016: (...) 2017: (...) 2018: (...)
How can I prevent it to change the order?
Thanks a lot!