后端返回字段,前端用sort进行正序排序
javascript
init() {
this.formLoading = true;
GetAllGalleryTestLevelTypeInfos()
.then((res) => {
res.data.sort((a,b)=>{
return a.serial_number-b.serial_number
})
this.data = res.data;
console.log( this.data," serial_number");
this.formLoading = false;
})
.catch((err) => {
console.log(err);
this.formLoading = false;
});
},