// 数组排序 var sortData = function sortArr(attr) {return function (a, b) {return a[attr] - b[attr] } } export default sortData; let newList = oldList.sort(sortData('xxx'));// 根据数组对象的 xxx 属性排序