其他分享
首页 > 其他分享> > 数组从大到小排序

数组从大到小排序

作者:互联网

 this.rightDataItem = [
          { name: '微信', color: '#06E1AE', money: formatMoney(dataRight.wx) },
          { name: '支付宝', color: '#0495FE', money: formatMoney(dataRight.ali) },
          { name: 'PayPal', color: '#FFC300', money: formatMoney(dataRight.paypal) },
          { name: '转账汇款', color: '#FF9403', money:  formatMoney(dataRight.transfer) },
          { name: '线下付款', color: '#B1B2FE', money: formatMoney(dataRight.offline) },
          { name: '钱包支付', color: '#F0579A', money: formatMoney(dataRight.wallet) }
        ]
        this.rightDataItem = this.rightDataItem.sort(this.sortDownDate)

 

方法:

  sortDownDate(a, b) {
        return  (b.money) - (a.money)
   },

 

标签:formatMoney,name,dataRight,color,money,rightDataItem,从大到,数组,排序
来源: https://www.cnblogs.com/guangzhou11/p/14240718.html