[英]AngularJS Boostrap tabs does not show anything for active tab when it is shown in dialog
I have many tabs in my showDialog, when I set tab_2
as active, the content shows nothing which is strange.我的 showDialog 中有很多选项卡,当我将tab_2
设置为活动时,内容没有显示任何奇怪的内容。
<div class="portlet-body">
<div class="tabbable-blue" id="my_tabDialog" style="margin:0px;">
<ul class="nav nav-tabs nav-tabs-lg">
<li id="li_tab_1">
<a data-toggle="tab" href="#" data-target="#tab_1">
MyTab1
</a>
</li>
<li id="li_tab_2" class="active">
<a data-toggle="tab" href="#" data-target="#tab_2">
MyTab2
</a>
</li>
</ul>
<div class="tab-content">
<div id="tab_1" class="tab-pane fade meter-tabs-height">
<div ng-include="'mytab1.html'"></div>
</div>
<div id="tab_2" class="tab-pane fade in meter-tabs-height" active>
<div ng-include="'mytab2.html'"></div>
</div>
</div>
</div>
</div>
When I firstly come into the dialog, the dialog shows MyTab2
with no content at all.当我第一次进入对话框时,对话框显示MyTab2
没有任何内容。 However, when I click MyTab1
and then reclick MyTab2
, the content appears.但是,当我单击MyTab1
然后重新单击MyTab2
时,会出现内容。
How does this happen and how could I handle this problem?Thank you.这是怎么发生的,我该如何处理这个问题?谢谢。
I have made a mistake in my code, just add class="active"
could resolve it.我在我的代码中犯了一个错误,只需添加class="active"
就可以解决它。
Replace代替
<div id="tab_2" class="tab-pane fade in meter-tabs-height" active>
<div ng-include="'mytab2.html'"></div>
</div>
with和
<div id="tab_2" class="tab-pane fade in meter-tabs-height active">
<div ng-include="'mytab2.html'"></div>
</div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.