2017-11-30 3 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() 구문을 사용하는 것입니다
관련 문제