computed: {
    newdataList: function() {
      return this.sortKey(this.dataList, "addtime");
    }
  },
  methods: {
    sortKey(array, key) {
      return array.sort(function(a, b) {
        var x = a[key];
        var y = b[key];
        return x > y ? -1 : x < y ? 1 : 0;
      });
    },
}

this.dataList为数据源


第二种:
Object.keys(sortedList).map(item=>{
sortedList[item] = sortedList[item].sort(x,y)=>{
return Date.parse(x.createTime) - Date.parse(y.createTime)
})
})

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-20
  • 2021-07-16
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-23
  • 2021-07-12
  • 2022-12-23
  • 2022-12-23
  • 2021-11-14
  • 2022-12-23
相关资源
相似解决方案