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

groupList(array, subGroupLength) {

    let index = 0;

    let newArray = [];

    while(index < array.length) {

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

}

    return newArray;

},

你可能感兴趣的:(vue中将数组分割成二维数组[[],[],[]])