本文介绍了如何使用Bootstrap 4安装popper.js?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据我到目前为止所读的内容,popper.js对于Bootstrap 4来说是一个很大的痛苦.我无法使其正常工作.我不断收到此错误:

From what I've read so far, popper.js is a big pain with Bootstrap 4. I can't get it to work. I keep getting this error:

我已经尝试安装CDN和NPM.结果相同.在HTML文件的底部,我安装了NPM:

I've tried the CDN and NPM install. Same result. At the bottom of my HTML file, I have this for the NPM install:

<script src="js/jquery.min.js"></script>
<script src="js/popper.min.js"></script>
<script src="js/tether.min.js"></script>
<script src="js/bootstrap.min.js"></script>

然后尝试使用CDN:

<script src="/js/jquery.min.js"></script>
<script src="/js/tether.min.js"></script>
<script src="https://cdnjs.com/libraries/popper.js"></script>
<script src="/js/bootstrap.min.js"></script>

有什么想法我在做什么错吗?

Any ideas what I'm doing wrong?

推荐答案

https://cdnjs.com/library/popper.js 看起来不像是popper的正确src,它没有指定文件

https://cdnjs.com/libraries/popper.js does not look like a right src for popper, it does not specify the file

使用bootstrap 4我正在使用

with bootstrap 4 I am using this

<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>

它运行正常,请尝试一下

and it is working perfectly fine, give it a try

这篇关于如何使用Bootstrap 4安装popper.js?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 14:22