我有modals.blade.php文件,其中保存了项目所需的所有模型。在主布局中,我包括该文件@include('parts.modals')。当我检查Firefox中的元素时,我看到该表单为空。当我将模态移动到主布局中时,它将按原样呈现。
<div class="modal fade" id="modal-contact" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Create a Contact</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form id="form-contact">
<div class="form-group">
<input type="text" class="form-control" name="first_name" placeholder="First Name">
</div>
<div class="form-group">
<input type="text" class="form-control" name="last_name" placeholder="Last Name">
</div>
<div class="form-group">
<input type="text" class="form-control" name="email" placeholder="Email">
</div>
</form>
</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 Contact</button>
</div>
</div>
</div>
</div>