sort排序

后端返回字段,前端用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;
        });
    },
相关推荐
福兮说2 小时前
设计稿是 #4A7C6F,页面量出来是 #4B7C6F:HEX、HSL、透明度、canvas 来回转的七个坑
前端·javascript·css·canvas
凤城老人4 小时前
从 PyQt6 到 Electron:给 Edge TTS 做一个“多角色配音机“的踩坑手记
javascript·typescript·electron
Dovis(誓平步青云)4 小时前
浇水提醒刚弹出又消失,植物状态别只存一个百分比
开发语言·前端·javascript·pdf·ecmascript·电脑
码艺-Alimjan5 小时前
Vben Admin 新增维吾尔语 Vben-Modal的关键坑之一
前端·javascript·vue.js
可乐鸡翅yeah_5 小时前
hls.js 手动自定义 http 请求 loader,修改请求头实战
开发语言·前端·javascript·网络协议·http·ecmascript·m3u8在线
yivifu6 小时前
中文古籍电子书注释集成
前端·javascript·python·beautifulsoup·epub
weixin_448290257 小时前
书庐开发实战教学
javascript·css·html
默_笙7 小时前
🛴 从散件到整机:DeepAgents 与 Agent 身上预留的那些"插槽"(前置介绍)
前端·javascript
一木 之林7 小时前
DeepSeek Agent 开发(一)
开发语言·前端·javascript
樱花落木兰9 小时前
分布式登录实战:Session 会话共享改造,Redis 存储用户登录状态
java·javascript·数据库·redis·分布式·缓存