The rewritten title is: SweetAlert2: "onBeforeOpen" parameters are unknown
P粉709644700
P粉709644700 2023-11-10 09:39:01
0
1
913

I'm using Laravel 5.8 and Sweetalert v2 and I'm trying to trigger this alert on Blade with it:

Swal.fire({
    title: '<h4 style="color: #0c5460;">Updating user status</h4>',
    html: '<h5 style="color: #0c5460">Wait...</h5>',
    width: 400,
    padding: '1em',
    background: '#fff url(/images/cream_pixels.png)',
    timer: 1000,
    onBeforeOpen: () => {
        Swal.showLoading()
    },
});

It pops up correctly but doesn't show the loader and shows me this error on the console:

SweetAlert2: Unknown parameter "onBeforeOpen"

So what’s the problem here?

P粉709644700
P粉709644700

reply all(1)
P粉676821490

Using didOpen: Runs asynchronously after the popup is shown on the screen. Provide popup DOM element as parameter

Swal.fire({
                didOpen: () => {
                  Swal.showLoading();
                }
              })
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template