/**
* receiveData 需要转换的数据
* name 数据以此属性就行分类,可自定义修改
* classificationData 用来接收分类完毕的数据
* 例子: [ {},{},{},{} ] => [ [{},{}] , [{},{}] ]
*/
let classificationData = Object.values(
receiveData.reduce((temp, item) => {
if (temp[item.name]) {
temp[item.name].push(item)
} else {
temp[item.name] = [item]
}
return temp
}, {})
)