【问题标题】:Module not found: Can't resolve 'bootstrap/less/bootstrap.less'找不到模块:无法解析“bootstrap/less/bootstrap.less”
【发布时间】:2019-10-23 00:42:46
【问题描述】:

我正在尝试使用 react-pagination,它运行良好,但没有引导程序。当我尝试使用它并导入引导程序时,出现了上面的错误。谁能帮我解决这个错误

require("bootstrap/less/bootstrap.less");

      <ReactPaginate
              previousLabel={'Previous'}
              nextLabel={'Next'}
              breakLabel={'...'}
              breakClassName={'break-me'}
              pageCount={(products.length / productsPerPage)}
              marginPagesDisplayed={2}
              pageRangeDisplayed={5}
              onPageChange={ (e)=> {console.log(1);
                setFromProduct(e.selected*productsPerPage)}}
              containerClassName={'pagination'}
              subContainerClassName={'pages pagination'}
              activeClassName={'active'}
            />

【问题讨论】:

    标签: reactjs pagination


    【解决方案1】:

    Bootstrap 4 不使用 LESS,但确实使用了 Scss。

    【讨论】:

    • 那么,我可以在我的分页中添加引导程序吗,它工作得很好但没有引导程序?
    • 你使用的是 webpack 还是 Create-React-App?如果您使用的是 webpack,则需要为 scss 配置加载器。如果您使用 CRA,您可能需要 eject
    猜你喜欢
    • 1970-01-01
    • 2020-10-05
    • 1970-01-01
    • 2017-10-23
    • 2021-10-16
    • 2021-08-16
    • 2019-05-10
    • 2021-10-17
    • 2021-11-01
    相关资源
    最近更新 更多