我无法使用新的 Twitter Bootstrap 版本:Bootstrap 4 alpha 让 Modal 在远程模式下工作。它与 Bootstrap 3 完美配合。使用 Bootstrap 4,我收到弹出窗口,但模型主体未加载。没有进行远程调用myRemoteURL.do
加载模型主体。
Code:
<button type="button" data-toggle="modal" data-remote="myRemoteURL.do" data-target="#myModel">Open Model</button>
<!-- Model -->
<div class="modal fade" id="myModel" tabindex="-1"
role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h3 class="modal-title" id="myModalLabel">Model Title</h3>
</div>
<div class="modal-body">
<p>
<img alt="loading" src="resources/img/ajax-loader.gif">
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Submit</button>
</div>
</div>
</div>
</div>
发现问题:他们删除了 bootstrap 4 中的远程选项
remote:此选项自 v3.3.0 起已弃用,并将在 v4 中删除。我们建议改用客户端模板或数据绑定框架,或者自己调用 jQuery.load。
我使用 JQuery 来实现这个被删除的功能。
$('body').on('click', '[data-toggle="modal"]', function(){
$($(this).data("target")+' .modal-body').load($(this).data("remote"));
});
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)