SweetAlert2示例不适用于IE11 .
以下代码不会与IE11一起运行:
swal({
title: 'Are you sure?',
text: "You won't be able to revert this!",
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, delete it!'
}).then((result) => {
if (result.value) {
swal(
'Deleted!',
'Your file has been deleted.',
'success'
)
}
})
1 回答
SweetAlert2示例使用了IE11无法处理的箭头功能和其他ES6好东西 .
解决此问题的简单方法是使用
function()
语法而不是() =>