Uncaught TypeError: Bootstrap's dropdowns require Popper.js when click on button group button

Uncaught TypeError: Bootstrap's dropdowns require Popper.js when click on button group button

我在我的mvc中使用了这段代码

<div class="btn-group" role="group">
   <button id="btnGroupDrop1" type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            Dropdown
   </button>
   <div class="dropdown-menu" aria-labelledby="btnGroupDrop1">
        <a class="dropdown-item" href="#">Dropdown link</a>
        <a class="dropdown-item" href="#">Dropdown link</a>
   </div>
</div>

我把这些作为 header 部分

但是当我点击按钮时它没有打开,我在浏览器的控制台部分收到这个错误

dropdown.js:154 ,
Uncaught TypeError: Bootstrap's dropdowns require Popper.js (https://popper.js.org/)

谁能帮我解决这个错误

您可能需要添加 popper.js 脚本,以使 bootstrap 正常运行。在 HTML.

中的 <head> 标签之间添加这个
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>

请务必按此顺序添加它们。

<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script>