2017-11-30 15 views
1

SweetAlert2の例はIE11では動作しません。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' 
    ) 
    } 
}) 

答えて

0

SweetAlert2例はアロー機能とIE11を扱うことができない他のES6のグッズを使用しています。
この問題を克服するための簡単な方法ではなく、() =>

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(function(result) { 
    if (result.value) { 
    swal(
     'Deleted!', 
     'Your file has been deleted.', 
     'success' 
    ) 
    } 
}) 
function()構文を使用することです
関連する問題