money() {
const money = this.cart.reduce((s, shop) => {
if (shop.check == true) {
s += shop.price * shop.count
}
return s
}, 0)
$('.jin2').html(money)
}
reduce 的购物车遍历累加
最新推荐文章于 2023-04-10 18:04:30 发布