根据字段排序数据列表,支持多字段排序
const list = [ { name: 'John', age: 25 }, { name: 'Jane', age: 30 },]const sortedList = listSort(list, ['name', 'age'], 'desc')const sortedList2 = listSort(list, ['name', 'age'], ['desc', 'asc']) Copy
const list = [ { name: 'John', age: 25 }, { name: 'Jane', age: 30 },]const sortedList = listSort(list, ['name', 'age'], 'desc')const sortedList2 = listSort(list, ['name', 'age'], ['desc', 'asc'])
数据列表
排序字段列表
排序类型,默认为'asc'
根据字段排序数据列表,支持多字段排序
Example