简体   繁体   English

AngularJS Boostrap 选项卡在对话框中显示时不显示活动选项卡的任何内容

[英]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.

相关问题 AngularJS将新标签添加到boostrap标签列表 - AngularJS add new tabs to boostrap tab list 选项卡的禁用和活动属性设置为true后,不会显示该选项卡。 Angularjs选项卡 - Tab is not shown after tab's disabled and active property are set to true. Angularjs Tabs 使用AngularJS,UI Boostrap和UI路由器时,活动选项卡默认为麻烦 - Trouble with active tab default using AngularJS, UI Boostrap, and UI Router 如何在angularjs中使用UI引导程序选项卡的内容动态地激活选项卡? - how to Dynamically Active tab with content for ui bootstrap tabs in angularjs? Angular.js:多个父子选项卡,使选项卡处于活动状态 - Angularjs: Multiple parent-child tabs, make tab active 如何在与angularjs一起使用的boostrap选项卡中设置路线 - how to set route in boostrap tabs using with angularjs angularjs显示/隐藏选项卡,单击相同选项卡隐藏内容 - angularjs show/hide tabs, click same tab hide the content AngularJS 如何在更改选项卡之前显示浏览器对话框保护 - AngularJS how to show browser dialog protects before changing tab 添加新选项卡时,AngularJS和AngularUI引导程序加倍选项卡 - AngularJS and AngularUI Bootstrap doubling tabs when adding a new tab Angular.js:动态创建的选项卡未激活/未选中 - Angularjs : Dynamically created tab does not get active/selected
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM