computed: {
filterCurrGoods: function () {
let filterGoods = [[], [], [], [], []]
this.currGoods.forEach(function (item, index) {
let goodsIndex = Math.floor(index / 6)
filterGoods[goodsIndex].push(item)
})
return filterGoods
}
},
vue把一个数组拆分为最多五个子数组的二维数组,每6个对象就push进去一个子数组
最新推荐文章于 2024-04-24 09:22:16 发布