编辑:忘了提,它应该在反应应用程序中
我正在尝试使用Bootstrap垂直药丸,但我tab-panel
消失了,并且在单击 other 时nav-link
,active
也没有更改为该链接。
这是代码:
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<div>
<div className="nav flex-column nav-pills" id="v-pills-tab" role="tablist" aria-orientation="vertical">
<a className="nav-link active" id="v-pills-one-tab" data-toggle="tab" href="#v-pills-one" role="tab" aria-controls="v-pills-mess" aria-selected="true">One</a>
<a className="nav-link" id="v-pills-two-tab" data-toggle="tab" href="#v-pills-two" role="tab" aria-controls="v-pills-report" aria-selected="false">Two</a>
<a className="nav-link" id="v-pills-three-tab" data-toggle="tab" href="#v-pills-three" role="tab" aria-controls="v-pills-emerging" aria-selected="false">Three</a>
<a className="nav-link" id="v-pills-four-tab" data-toggle="tab" href="#v-pills-four" role="tab" aria-controls="v-pills-workf" aria-selected="false">Four</a>
<a className="nav-link" id="v-pills-five-tab" data-toggle="tab" href="#v-pills-five" role="tab" aria-controls="v-pills-prebuild" aria-selected="false">Five</a>
</div>
<div className="tab-content" id="v-pills-tabContent">
<div className="tab-pane fade show active" id="v-pills-one" role="tabpanel" aria-labelledby="v-pills-one-tab">One</div>
<div className="tab-pane fade" id="v-pills-two" role="tabpanel" aria-labelledby="v-pills-two-tab">Two</div>
<div className="tab-pane fade" id="v-pills-three" role="tabpanel" aria-labelledby="v-pills-three-tab">Three</div>
<div className="tab-pane fade" id="v-pills-four" role="tabpanel" aria-labelledby="v-pills-four-tab">Four</div>
<div className="tab-pane fade" id="v-pills-five" role="tabpanel" aria-labelledby="v-pills-five-tab">Five</div>
</div>
</div>
请帮忙!
这是当前状态: 当前
这就是这段代码的所在,是的,我知道版本并且包含了所有内容。
https://getbootstrap.com/docs/4.0/components/navs/
谢谢!