单击外部时如何禁用模式关闭? [实体化]
How to disable modal closing when clicking outside? [Materialize]
我有一个具体化模式,我想知道如何在您单击离开时禁用它的关闭。按照我的代码:
<div id="hscal" class="modal modal-fixed-footer">
<h1 class="h4">Histórico de Calibração</h1>
<div class="modal-content">
<table id="bodymodal" class="highlight centered"></table>
</div>
<div class="modal-footer">
<button
class="btn waves-effect waves-light col-sm-1 col-md-2 col-lg-2 close-modal"
type="reset"
id="fx"
name="action"
href="#"
v-on:click="exitModal"
>Fechar
<i id="iconbtn" class="material-icons right">clear</i>
</button>
</div>
</div>
您可以在 initialisation 期间设置此项和许多其他修改:
// with jQuery
$('.modal').modal({
dismissible: false
});
// Vanilla JS
document.addEventListener('DOMContentLoaded', function() {
var elems = document.querySelectorAll('.modal');
var instances = M.Modal.init(elems, {
dismissible: false
});
});
我有一个具体化模式,我想知道如何在您单击离开时禁用它的关闭。按照我的代码:
<div id="hscal" class="modal modal-fixed-footer">
<h1 class="h4">Histórico de Calibração</h1>
<div class="modal-content">
<table id="bodymodal" class="highlight centered"></table>
</div>
<div class="modal-footer">
<button
class="btn waves-effect waves-light col-sm-1 col-md-2 col-lg-2 close-modal"
type="reset"
id="fx"
name="action"
href="#"
v-on:click="exitModal"
>Fechar
<i id="iconbtn" class="material-icons right">clear</i>
</button>
</div>
</div>
您可以在 initialisation 期间设置此项和许多其他修改:
// with jQuery
$('.modal').modal({
dismissible: false
});
// Vanilla JS
document.addEventListener('DOMContentLoaded', function() {
var elems = document.querySelectorAll('.modal');
var instances = M.Modal.init(elems, {
dismissible: false
});
});