gpt4 book ai didi

bootstrap-4 - 如何将 Popper.js 与 Bootstrap 4 beta 一起使用

转载 作者:行者123 更新时间:2023-12-03 05:43:36 25 4
gpt4 key购买 nike

我是老派,所以我将源代码下载到1.12.0,然后执行以下操作:

<script src="/popper.js-1.12.0/dist/popper.js"></script>
<script src="/bootstrap-4.0.0-beta/dist/js/bootstrap.js"></script>

但我得到:

Uncaught SyntaxError: Unexpected token export

在线 2294 上写着:

export default Popper;

最佳答案

您想要使用 package.json file as main entry 中指定的 dist 目标.

在本例中,您正在寻找 umd构建( dist/umd/popper.js )

什么是 UMD?

The UMD pattern typically attempts to offer compatibility with the most popular script loaders of the day (e.g RequireJS amongst others). In many cases it uses AMD as a base, with special-casing added to handle CommonJS compatibility.

这意味着 UMD bundle 可以通过 <script> 加载标记并注入(inject)到全局范围内 ( window ),但如果需要,也可以使用 CommonJS 加载器(例如 RequireJS)来工作。

关于bootstrap-4 - 如何将 Popper.js 与 Bootstrap 4 beta 一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45694811/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com