美文网首页
vue中将数组分割成二维数组[[],[],[]]

vue中将数组分割成二维数组[[],[],[]]

作者: 雨后晴阳 | 来源:发表于2019-12-04 13:58 被阅读0次

groupList(array, subGroupLength) {

    let index = 0;

    let newArray = [];

    while(index < array.length) {

        newArray.push(array.slice(index, index += subGroupLength));

}

    return newArray;

},

相关文章

网友评论

      本文标题:vue中将数组分割成二维数组[[],[],[]]

      本文链接:https://www.haomeiwen.com/subject/ztflgctx.html