账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    sweetalert2 弹出框瞬间消失
    32
    0

    在laravel程序的自定义js代码中使用sweetalert2插件,无论是简单的弹出框还是确认框都是弹出瞬间即消失,并且默认执行了确认操作。

    但是在chrome的Console里却可以正常弹出和执行。

    简单的弹出框

    swal('更新成功','','success');

    确认框

    在jQuery的click事件中执行。(官方样例)

    swal({
        title: '你确定吗?',
        text: '',
        type: 'warning',
        showCancelButton: true,
        confirmButtonColor: '#EE5C42',
        cancelButtonColor: '#71C671',
        confirmButtonText: '确定删除',
        cancelButtonText: '留着吧'
    }).then(function() {
        swal(
            '删除成功',
            '',
            'success'
            )
    }, function(dismiss) {
          // dismiss can be 'overlay', 'cancel', 'close', 'esc', 'timer'
          if (dismiss === 'cancel') {
              swal(
                  '取消删除',
                  '',
                  'error'
                  )
          }
        });
    
    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • 溃烂模样 普通会员 1楼
      502 Bad Gateway

      502 Bad Gateway


      nginx
    更多回答
    网站公告
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部