按照某一字段排序(sort)升序:
productType.sort(function (a, b) {
return b.sort < a.sort ? 1 : -1
});
降序:
productType.sort(function (a, b) {
return b.sort < a.sort ? -1 : 1
});
this.productType=productType.sort(function (a, b) {
return b.sort < a.sort ? 1 : -1
});
![](https://img-blog.csdnimg.cn/img_convert/720a080905637065b1e67b40eb229a48.png)