首页 > 解决方案 > 为什么引导面板切换在 reactjs 构建版本中不起作用?

问题描述

我可以在我的 reactjs 开发中添加引导面板切换。但是当我部署反应构建代码时,这个面板没有扩展。而且我知道为什么它在构建代码中不起作用,因为我正在使用href="#panl". 那么我该如何解决这个问题呢?

render() {
    return <div>
        <a data-toggle="collapse" href="#panl">Testing</a>
        <div className="panel-collapse collapse section-two" id="pan1">
            <h1>Here is contant of the panel</h1>
        </div>
    </div>
}

标签: javascriptcssreactjsbootstrap-4

解决方案


您可能没有正确安装引导程序。运行这些命令来安装它。

npm uninstall --save bootstrap
npm install --save bootstrap

推荐阅读