我试图使用Bootstrap 5.1.3尝试在导航栏中添加下拉菜单
我遇到了试图使用Bootstrap实现下拉菜单的问题,所有链接显示出与我无效的相同结果,我有以下代码,如前所述,我正在使用Bootstrap 5.1.3,
<div class="dropdown">
<button type="button" class="nav-link text-white bg-dark align-right border-0 dropdown-toggle" id="navbarDropdown" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown button
</button>
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
<li><a href="dropdown-item" (click)="logOut()">log out</a></li>
</ul>
</div>
结果显示了结果。 “下拉按钮”没有注销按钮,但是当我单击时,它不会打开下拉菜单
i'm running into issues trying to implement a dropdown menu using bootstrap, all the links show the same result which isn't working for me, i have the following code and as mentioned i'm using bootstrap 5.1.3
<div class="dropdown">
<button type="button" class="nav-link text-white bg-dark align-right border-0 dropdown-toggle" id="navbarDropdown" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown button
</button>
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
<li><a href="dropdown-item" (click)="logOut()">log out</a></li>
</ul>
</div>
the result shows the "Dropdown button" without the log out button, however it doesn't open up the drop down menu as i click on it
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试在Angular中添加JS
。
Did you try to add the js in angular.json , I think this problem comme from the js
Angular.json: