//数据类型
recordsInfo: [
{
id:'1',
flowEndTime: '2022-2-19 15:30:30'
},
{
id:'1',
flowEndTime: '2022-2-19 16:50:30'
}
]
//排序方法
for (let i = 0; i < _this.recordsInfo.length - 1; i++) {
for (let j = 0; j < _this.recordsInfo.length - 1 - i; j++) {
if (Date.parse(_this.recordsInfo[j].flowEndTime) >
Date.parse(_this.recordsInfo[j+1].flowEndTime)) {
var temp = _this.recordsInfo[j];
_this.recordsInfo[j] = _this.recordsInfo[j + 1];
_this.recordsInfo[j + 1] = temp;
}
}
}