Bootstrap 4: Uncaught ReferenceError: Popper is not defined 错误

错误:

最近项目中引入Bootstrap 时报错:Uncaught ReferenceError: Popper is not defined 


原因:

Bootstrap 4 中 bootstrap.bundle.js 存在对 Popper.js 的引用,因此需要在引入Bootstrap之前引用 Popper.js  文件


需要注意的是,必须是 UMD  版本的  Popper.js  文件文件,否则会报错:Uncaught SyntaxError: Unexpected token export


    


popper.js 下载地址: https://cdnjs.com/libraries/popper.js

  Bootstrap v4.1.0  选择   1.14.0 popper.js

    

猜你喜欢

转载自blog.csdn.net/write6/article/details/80054141