下面的代码可以在单击按钮时触发模式
<button type="button" class="btn btn-danger ml-3 trans-3"
[swal]="swalDeleteConfig"
(confirm)="deleteItem($event)">
Delete
</button>
传递适当的选项对象
private swalDeleteConfig: SweetAlertOptions = {
title: 'Are you sure you want to delete?',
confirmButtonText: "Delete",
confirmButtonClass: 'btn btn-danger',
showCancelButton: true,
cancelButtonText: "Cancel",
cancelButtonClass: 'btn',
type: "question",
customClass: {
actions: "mt-5 mb-5"
}
}
此操作无需为模式指定HTML。如何手动响应此事件触发此事件?例如,异步操作完成后的烤面包。