BootstrapDailog在带有Jquery 3.3.1的Bootstrap4中不起作用

时间:2018-06-29 11:24:48

标签: bootstrap-4 android-webview jquery-3 jquery-migrate bootstrap-dialog

我在调用BootstrapDialog.confirm时将BootstrapDialog与Bootstrap4和Jquery3.3.1一起使用,它将在较旧版本的chrome中抛出错误“未捕获的TypeError:Object.keys调用非对象”。我还添加了Jquery-migrate3 .0.0但不起作用。但是BootstrapDialog可以与Bootstrap3和jquery-2.2.3一起正常工作

1 个答案:

答案 0 :(得分:0)

Bootstrap 4对话框或模式有点奇怪。但是请尝试此解决方案,并希望它对您有用。

    <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModalCenter">
  Launch demo modal
</button>

<div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
  <div class="modal-dialog modal-dialog-centered" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalCenterTitle">Modal title</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        ...
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save changes</button>
      </div>
    </div>
  </div>
</div>