目标是用 bootstrap 4 药丸或 navs 制成药丸。所以它具有树结构,就像每个类别都有子类别并且它们是动态的。
这是我到目前为止所尝试的:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" />
<ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="pills-cvar-summary-tab" data-toggle="pill" href="#pills-cvar-summary" role="tab" aria-controls="pills-cvar-summary" aria-selected="true">Climate VaR Summary</a>
</li>
<li class="nav-item">
<a class="nav-link" id="pills-cvar-sector-analysis-tab" data-toggle="pill" href="#pills-cvar-sector-analysis" role="tab" aria-controls="#pills-cvar-sector-analysis" aria-selected="false">Sector Analysis</a>
</li>
<li class="nav-item">
<a class="nav-link" id="pills-cvar-country-analysis-tab" data-toggle="pill" href="#pills-cvar-country-analysis" role="tab" aria-controls="#pills-cvar-country-analysis" aria-selected="false">Country Analysis</a>
</li>
</ul>
<div class="tab-content" id="pills-tabContent">
<div class="tab-pane fade show active" id="pills-cvar-summary" role="tabpanel" aria-labelledby="pills-cvar-summary-tab">
<ul class="nav nav-pills mb-3" id="pills-tab-1" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="pills-cvar-summary-primary-tab" data-toggle="pill" href="#pills-cvar-summary-primary" role="tab" aria-controls="pills-cvar-summary-primary" aria-selected="true">Primary Info & Allocation</a>
</li>
<li class="nav-item">
<a class="nav-link active" id="pills-cvar-summary-portfolio-analysis-tab" data-toggle="pill" href="#pills-cvar-summary-portfolio-analysis" role="tab" aria-controls="#pills-cvar-summary-portfolio-analysis" aria-selected="false">Portfolio Analysis</a>
</li>
<li class="nav-item">
<a class="nav-link active" id="pills-cvar-summary-spread-tab" data-toggle="pill" href="#pills-cvar-summary-spread" role="tab" aria-controls="#pills-cvar-summary-spread" aria-selected="false">spread</a>
</li>
</ul>
<div class="tab-content" id="pills-tab-1Content">
<div class="tab-pane fade" id="pills-cvar-summary-primary" role="tabpanel" aria-labelledby="pills-cvar-summary-primary-tab">
11111111
</div>
</div>
</div>
<div class="tab-pane fade" id="pills-cvar-summary-portfolio-analysis" role="tabpanel" aria-labelledby="pills-cvar-summary-portfolio-analysis-tab">
2
</div>
<div class="tab-pane fade" id="pills-cvar-summary-spread" role="tabpanel" aria-labelledby="pills-cvar-summary-spread-tab">
3
</div>
</div>