Angular 引导程序4中的下拉错误
我在Bootstrap4文档中创建了下拉列表[ 但当我点击按钮时,它给出了下面的错误Angular 引导程序4中的下拉错误,angular,bootstrap-4,Angular,Bootstrap 4,我在Bootstrap4文档中创建了下拉列表[ 但当我点击按钮时,它给出了下面的错误 <div class="btn-group"> <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Manage Recipe</button> <div
<div class="btn-group">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Manage Recipe</button>
<div class="dropdown-menu">
<a href="#" class="dropdown-item">To Shopping List</a>
<a href="#" class="dropdown-item">Edit Recipe</a>
<a href="#" class="dropdown-item">Delete Recipe</a>
</div>
</div>
应在引导本身之前导入依赖项,因为后者将尝试使用尚未导入的来自Popper或jQuery的函数。因此,您必须在引导之前放置
Popper.min.js
:
...
"scripts": [
"../node_modules/jquery/dist/jquery.slim.min.js",
"../node_modules/popper.js/dist/umd/popper.min.js",
"../node_modules/bootstrap/dist/js/bootstrap.min.js"
],
检查顺序。它应该是jquery,然后是popper,然后是bootstrap
...
"scripts": [
"../node_modules/jquery/dist/jquery.slim.min.js",
"../node_modules/popper.js/dist/umd/popper.min.js",
"../node_modules/bootstrap/dist/js/bootstrap.min.js"
],