下拉菜单点击没有反应 bootstrap5

原因:
一般是引入js文件的时候,顺序搞错了或者未引入bootstrap.bundle.js。

解决方法:
使用npm install bootstrap导入bootstrap包

<!--引入bootstrap核心js文件-->
<script type="text/javascript" src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="node_modules/bootstrap/dist/js/bootstrap.bundle.js"></script>

以上两个文件缺一不可,且不可以顺序调换

猜你喜欢

转载自blog.csdn.net/weixin_45928096/article/details/129191528