引导程序中的选项卡窗格现在显示

时间:2018-09-25 09:29:14

标签: css reactjs mdbootstrap nav-pills

编辑:忘了提及,它应该在React应用中

我正在尝试使用 Bootstrap 垂直药丸,但我的tab-panel消失了,并且在单击其他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>

请帮助!

这是当前状态: current

这是这段代码的位置,是的,我知道版本,并包含了所有内容。

https://getbootstrap.com/docs/4.0/components/navs/

谢谢!

1 个答案:

答案 0 :(得分:0)

问题出在选项卡窗格的淡入淡出中,当删除淡入淡出时,所有显示的内容都应该...