简体   繁体   English

类型错误:e 在 popper.min.js 中未定义?

[英]TypeError: e is undefined in popper.min.js?

I'm an working in Angular 8 and added Bootstrap via npm using below commands我在 Angular 8 中工作,并使用以下命令通过 npm 添加了 Bootstrap

npm install jquery
npm install popper.js
npm install ngx-bootstrap bootstrap@4.1.1
(have tried npm install bootstrap as well) (也试过 npm install bootstrap )

and updated my angular.json as below with styles and scripts.并使用样式和脚本更新了我的 angular.json 如下。

"styles": [
              "src/styles.css",
              "./node_modules/bootstrap/dist/css/bootstrap.min.css",
              "./node_modules/font-awesome/css/font-awesome.css"
            ],
            "scripts": [
              "./node_modules/jquery/dist/jquery.min.js",
              "./node_modules/popper.js/dist/umd/popper.min.js",
              "./node_modules/bootstrap/dist/js/bootstrap.min.js"

            ]

I have added a code of drop-down in html file but its not working while checking in console I am getting popper.min.js error.我在 html 文件中添加了一个下拉代码,但在检查控制台时它不起作用我收到 popper.min.js 错误。

And the html script is :而 html 脚本是:

<div class="col-6 text-left">
                            <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown">
                                    Project A
                            </button>
                            <div class="dropdown-menu">
                                    <a class="dropdown-item" href="#">Project A</a>
                                    <a class="dropdown-item" href="#">Project B</a>
                                    <a class="dropdown-item" href="#">Project C</a>
                                    <a class="dropdown-item" href="#">Project E</a>
                            </div>
                    </div>

@Tony Ngo please find screenshot ( after changing order of popper and bootstrap) @Tony Ngo 请找到截图(更改popper 和bootstrap 的顺序后)

在此处输入图片说明

Your import order should be like this你的导入顺序应该是这样的

 "node_modules/jquery/dist/jquery.min.js",
 "node_modules/bootstrap/dist/js/bootstrap.min.js",
 "node_modules/popper.js/dist/umd/popper.min.js",

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM