Sweetalert: キャッチされない例外:キャンセル

作成日 2016年12月01日  ·  5コメント  ·  ソース: t4t5/sweetalert

このエラーは、Sweetalert2の[キャンセル]ボタンをクリックすると表示されます

swal({ title: menu_title, text: title, input: "text", showCancelButton: true, animation: "slide-from-top", showLoaderOnConfirm: true, inputPlaceholder: lang.write_your_comment, preConfirm: function(inputValue) { return new Promise(function(resolve, reject) { resolve('ok'); }); }) }, allowOutsideClick: false }).then(function(result){ var res = $.parseJSON(result); if(res.status){ swal({ title: lang.thankyou+"!", text: lang.your_feedback_sent, type: "success" }).then(function(confirm){ location.reload(); }); } else{ swal({ title: lang.sorry+"!", text: res.message, type: "warning" }); } });

最も参考になるコメント

誰かがここに来て行き詰まった場合( sweetalert != sweetalert2 !)

swal({...})の最後に、次を追加します: .catch(() => swal.close())

すべてのpromise関数には失敗コールバックが必要です。

全てのコメント5件

閉じるアイコンをクリックすると、エラーも表示されますが、
キャッチされない例外:閉じる

ここに投稿する必要があります: https

誰かがここに来て行き詰まった場合( sweetalert != sweetalert2 !)

swal({...})の最後に、次を追加します: .catch(() => swal.close())

すべてのpromise関数には失敗コールバックが必要です。

@eminxあなたは私の日を救った:)

@eminx私も!!

このページは役に立ちましたか?
0 / 5 - 0 評価