数据:
list: [
{
time: "2012/09/10",
},
{
time: "2023/08/19",
},
{
time: "2022/08/19",
},
{
time: "2021/06/22",
},
{
time: "2069/03/19",
},
{
time: "2018/02/06",
},
],
排序:
this.list.sort((a, b) => {
return Date.parse(a.time.replace(/-/g, "/")) - Date.parse(b.time.replace(/-/g, "/"))
});
console.log(this.list, "排序好的数据");