我正在尝试使用https://react-bootstrap.github.io/上的包
它只是说你必须 npm 安装该软件包,然后对浏览器全局变量有一些非常模糊的说明:
We provide react-bootstrap.js and react-bootstrap.min.js bundles with all components exported on the window.ReactBootstrap object. These bundles are available on unpkg, as well as in the npm package.
<script src="https://unpkg.com/react/umd/react.production.min.js" crossorigin></script>
<script
src="https://unpkg.com/react-dom/umd/react-dom.production.min.js"
crossorigin></script>
<script
src="https://unpkg.com/react-bootstrap@next/dist/react-bootstrap.min.js"
crossorigin></script>
<script>var Alert = ReactBootstrap.Alert;</script>
Run Code Online (Sandbox Code Playgroud)
以及他们提供的 CDN。
How and which Bootstrap styles you include is up to you, but the simplest way is to include the latest styles from the CDN. A little more information about the benefits of using …Run Code Online (Sandbox Code Playgroud)