function _chunk(arr, num) {
let j = 0,
o = j;
let newArray = [];
while (j < arr.length) {
j += num;
newArray.push([arr.slice(o, j)]);
o = j;
}
return newArray;
}
var list = _chunk(this.data.listlunbos, 10);
把数组拆成10个为一个数组
最新推荐文章于 2023-09-04 10:09:50 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)