You must add this code in your theme's folder.
Magento_Checkout/templates/cart/form.phtml
require([
'jquery',
'mage/translate',
'Magento_Ui/js/modal/confirm',
"mage/template",
], function ($, $t, confirm, mageTemplate) {
$('.action-delete').click(function (e) {
e.stopPropagation();
confirm({
title: $t("Remove item cart"),
content: $t("Do you want remove this item of the cart?"),
modalClass: "classModal",
actions: {
confirm: function () {
var params = $(e.currentTarget).data('post');
var formTemplate = '<form action="<%- data.action %>" method="post">'
+ '<% _.each(data.data, function(value, index) { %>'
+ '<input name="<%- index %>" value="<%- value %>">'
+ '<% }) %></form>';
var formKeyInputSelector = 'input[name="form_key"]';
var formKey = $(formKeyInputSelector).val();
if (formKey) {
params.data.form_key = formKey;
}
$(mageTemplate(formTemplate, {
data: params
})).appendTo('body').hide().submit();
}
}
});
})
});