$(document).on('click', '[data-role="tabledel"]', function() {
var stockuniqueid = $(this).attr('data-stockuniqueid');
//删除对应数据
for (var i = 0; i < checkbox.length; i++) {
if (checkbox[i]['stock'].stock_unique_id === stockuniqueid) {
checkbox.splice(i, 1);
i = i - 1;
}
}
});
重点就是这个 ↓ ↓ ↓
for (var i = 0; i < checkbox.length; i++) {
if (checkbox[i]['stock'].stock_unique_id === stockuniqueid) {
checkbox.splice(i, 1);
i = i - 1;
}
}