let arr = [
{name: '西安市1', value: '100%'},
{name: '西安市2', value: '99%'},
{name: '西安市3', value: '100%'},
{name: '威阳市2', value: '88.2%'},
{name: '榆林市2', value: '66.6%'},
{name: '榆林市1', value: '34.2%'},
{name: '延安市4', value: '80%'},
{name: '南洛市2', value: '90%'},
{name: '榆林市9', value: '81.3%'},
{name: '榆林市0', value: '34.2%'}
];
arr.sort((a, b) => {
return parseInt(b.value) - parseInt(a.value)
});
arr.sort((a, b) => {
return parseInt(a.value) - parseInt(b.value)
});
网友评论