// 删除选中的商品
//cartStores.shop 代表购物车数组数据
const selectDel = ()=>{
const uncheckedItems = computed(() =>cartStores.shop.filter(item => !item.check));
cartStores.shop = uncheckedItems.value
}
购物车删除选中的商品
本文介绍了一个使用JavaScript的computed和filter方法,针对购物车数组`cartStores.shop`中未被勾选的项目进行操作,更新购物车状态以清除未选中的商品。
956

被折叠的 条评论
为什么被折叠?



