let dataList =[{"showOrder":"2","name":"李四","age":"18"},{"showOrder":"4","name":"马六","age":"30"},{"showOrder":"3","name":"王五","age":"24"},{"showOrder":"1","name":"张三","age":"15"}]
dataList.sort(this.compare)
compare(obj1, obj2) {
let val1 = obj1.showOrder;
let val2 = obj2.showOrder;
if(val1 < val2) {
return -1;
}elseif(val1 > val2) {
return 1;
}else {
return 0;
}
},