【问题标题】:CSS not loading correctly With React-bootstrap-typeahead使用 React-bootstrap-typeahead 无法正确加载 CSS
【发布时间】:2020-06-25 15:34:09
【问题描述】:

我正在尝试使用 Meteor 和 react 语法来实现预输入。我找到了这个library,它看起来非常好,但我在使用 CSS 时遇到了一些问题。
我的实际代码如上图所示 Real Code 正如我们在上图中看到的那样,功能是存在的,但显然 CSS 错误

知道我做错了什么吗?

【问题讨论】:

  • 看起来您正确地包含了 CSS 以及您的代码。我假设您正在使用像 webpack 这样的捆绑器来为浏览器创建一个包?你可以发布你的配置吗?我最好的猜测是您没有启用适当的加载器来处理 CSS。作为测试,您也可以尝试在 index.html 文件中包含 CSS 以查看是否可行。
  • 好吧,我现在才意识到没有加载引导程序.. import 'bootstrap/dist/css/bootstrap.min.css' 修复错误。所以菜鸟..顺便谢谢你

标签: react-bootstrap-typeahead


【解决方案1】:

将 bootstrap.min.js 导入您的应用程序。
使用以下链接: https://react-bootstrap.github.io/getting-started/introduction/

将 bootstrap.min.css 导入您的应用程序。
使用以下链接: https://react-bootstrap.github.io/getting-started/introduction/#stylesheets
在我的情况下,将此添加到 html 中。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-22
    • 2018-11-15
    • 1970-01-01
    • 2014-11-06
    相关资源
    最近更新 更多