数组拆分,多用于单个数组拆分多个数组,用处swiper里面

group(array, subGroupLength) {
      let index = 0;
      let newArray = [];
      while(index < array.length) {
          newArray.push(array.slice(index, index += subGroupLength));
      }
      return newArray;
    },

  

that.group(array,6)
posted @ 2022-05-25 14:25  Brian_白  阅读(45)  评论(0编辑  收藏  举报