E企盈营销工具技术服务商 热线:4006-838-530

微信小程序:js获得两层(多层)数组最里层的的length(举个栗子,栗子重复的话,抱歉)

E企盈直播平台营销卖货系统

想要获得TtimeList的总个数数据如下:teacherList: [      {        Tname: ‘aaaaaa’,        Ttime: ‘aaaaaaaaaaaaa’,        TtimeList: [          {            Ltime: ‘aaaaaaaaaaaaaaaaa’,            Lunit: ‘aaaaaaaaaaaaaaaaaaaaaaaaaaaa’          }        ]      },      {        Tname: ‘bbbbbb’,        Ttime: ‘bbbbbbbbbbbbbbbbbbb’,        TtimeList: [          {            Ltime: ‘bbbbbbbbbbbbbbbb’,            Lunit: ‘bbbbbbbbbbbbbbbbbbbbbbbbbb’          },          {            Ltime: ‘bbbbbbbb’,            Lunit: ‘bbbbbbbbbbbbbb’          },        ]      }, {        Tname: ‘cccc’,        Ttime: ‘ccccccccccc’,        TtimeList: [          {            Ltime: ‘ccccccccccccccccc’,            Lunit: ‘ccccccccccccccccccccccccc’          },          {            Ltime: ‘ccccccccc’,            Lunit: ‘cccccccccccccccccccccccccccccccccc’          },        ]      }    ],    courseOutline: 0,js如下:var len2 = 0;    for (var L1 = 0; L1 this.data.teacherList.length; L1++) {      var newArr = this.data.teacherList[L1].TtimeList;      for (var L2 = 0; L2 newArr.length; L2++) {       // console.log(newArr[L2]);        len2++;      }    }    // console.log(len2);    this.setData({      courseOutline: len2    })wxml如下: view{{courseOutline}}次课/view

赞(0) 打赏
未经允许不得转载:E企盈小程序开发-热线:4006-838-530 » 微信小程序:js获得两层(多层)数组最里层的的length(举个栗子,栗子重复的话,抱歉)
分享到: 更多 (0)
E企盈小程序直播营销卖货系统
E企盈直播平台营销卖货系统

评论 抢沙发

E企盈小程序开发

联系我们联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏