导入 bootstrap 来反应 Atom?

Import bootstrap to react Atom?

我已使用以下代码成功将 Jquery 导入 atom:

从 'jquery' 导入 $;

导入 css-bootstrap 的等效项是什么?

注意: 我已成功将 bootstrap 安装到我的项目文件夹中(使用命令行):

$ npm install react-bootstrap --save

您可以使用 bootstrap 的 CDN(取自 https://react-bootstrap.github.io/getting-started.html):

Because React-Bootstrap doesn't depend on a very precise version of Bootstrap, we don't ship with any included css. However, some stylesheet is required to use these components. How and which bootstrap styles you include is up to you, but the simplest way is to include the latest styles from the CDN.

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap-theme.min.css">

或者您可以尝试安装常规 bootstrap 模块:

npm install bootstrap@4.0.0-alpha.6

并将以下行添加到您的 client.js(确保您设置的路径正确):

import 'bootstrap/dist/css/bootstrap.css';

我通常会使用

导入常规 bootstrap
npm install bootstrap@4.0.0-alpha.6

然后在我的应用程序中像这样调用它

import 'bootstrap/dist/css/bootstrap.css'

我还建议使用 atom autocomplete-modules 包来帮助在模块中找到所需的文件

请记住,如果您使用 create-react-app 来帮助导入 JavaScript

中的资产,它将起作用