SweetAlert2:未知参数“ onbeopen”

发布于 2025-02-12 15:41:55 字数 617 浏览 1 评论 0原文

我正在使用laravel 5.8和 sweetalert v2 ,我尝试在刀片上使用它发射此警报

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()
    },
});

:弹出窗口正确但没有显示加载程序,并在控制台上向我显示了此错误:

sweetAlert2:未知参数“ onbeopen”

so这里出了什么问题?

I'm using Laravel 5.8 and Sweetalert v2 and I tried firing this alert with it at the Blade:

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()
    },
});

And it popups properly but does not show the loader and shows me this error at the Console:

SweetAlert2: Unknown parameter "onBeforeOpen"

So what's going wrong here?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

空城仅有旧梦在 2025-02-19 15:41:56

使用 didopen :在屏幕上显示弹出窗口后,异步运行。提供弹出式DOM元素作为参数

              Swal.fire({
                didOpen: () => {
                  Swal.showLoading();
                }
              })

Use didOpen: Asynchronously runs after the popup has been shown on screen. Provides popup DOM element as the argument

              Swal.fire({
                didOpen: () => {
                  Swal.showLoading();
                }
              })
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文