es6 productListvalueforEachitem = ifeproductCode == itemproductCode delete item productCode 相同删除item 原数组更新
To update the original array by deleting items with the same productCode, you can use the filter() method instead of forEach():
productList.value = productList.value.filter(item => e.productCode !== item.productCode);
This code will filter out all the items in productList.value that have a different productCode than e.productCode, effectively removing the items with the same productCode from the array. The updated array is then assigned back to productList.value.
原文地址: https://www.cveoy.top/t/topic/i0ZB 著作权归作者所有。请勿转载和采集!