0
私は甘いアラートライブラリを使用しています:どのように私は私の活字体のエラー解決することができます。プロパティを「を」type「を無効」に存在しません
https://limonte.github.io/sweetalert2/
と私はサイトから、次のコードを使用しようとしています:
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!',
cancelButtonText: 'No, cancel!',
confirmButtonClass: 'btn btn-success',
cancelButtonClass: 'btn btn-danger',
buttonsStyling: false
}).then(function() {
swal(
'Deleted!',
'Your file has been deleted.',
'success'
)
}, function (dismiss) {
// dismiss can be 'cancel', 'overlay',
// 'close', and 'timer'
if (dismiss === 'cancel') {
swal(
'Cancelled',
'Your imaginary file is safe :)',
'error'
)
}
})
私は実行することにより、種類をインストールしました:
npm install --save @types/sweetalert
が、私はまだ使用に関連して、エラーメッセージを取得しています「then」の:
error TS2339: Property 'then' does not exist on type 'void'.
どうすれば解決できますか?