Laravel 8 无法触发模态和下拉
Laravel 8 Can't Trigger Modal and Dropdown
所以我想在我的项目中使用 bootstrap 模态,我遵循了关于模态的官方 bootstrap 文档,为了测试它我只是简单地将代码复制并粘贴到我的 blade.不知何故,在我按下按钮后,模态没有出现。我非常确定遵循了文档。
我意识到这也发生在下拉功能
谁能帮我解决这个问题?
模态
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">
Launch demo modal
</button>
<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</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>
下拉菜单:
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown button
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</div>
在阅读他们的评论后向 Rouhollah Mazarei and Rwd 大声疾呼,我对代码进行了一些重新检查,发现 js 和 css 包含代码丢失了。它仍然适用于我的另一个 blade,所以我认为它已经包含在内。谢谢
所以我想在我的项目中使用 bootstrap 模态,我遵循了关于模态的官方 bootstrap 文档,为了测试它我只是简单地将代码复制并粘贴到我的 blade.不知何故,在我按下按钮后,模态没有出现。我非常确定遵循了文档。
我意识到这也发生在下拉功能
谁能帮我解决这个问题?
模态
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">
Launch demo modal
</button>
<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</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>
下拉菜单:
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown button
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</div>
在阅读他们的评论后向 Rouhollah Mazarei and Rwd 大声疾呼,我对代码进行了一些重新检查,发现 js 和 css 包含代码丢失了。它仍然适用于我的另一个 blade,所以我认为它已经包含在内。谢谢