交集,切割数组
let cartIds = [] // 定义选中的购物车id
this.result.forEach(item => {
cartIds.push(item.cartId)
})
test = this.cartList.filter((item, index) => {
return cartIds.indexOf(item.cartId) === -1
})
console.log(test)
this.cartList = test
切割数组
sliceArray (array, size) {
var result = []
for (var x = 0; x < Math.ceil(array.length / size); x++) {
var start = x * size
var end = start + size
result.push(array.slice(start, end))
}
return result
},