简体   繁体   English

UIB选项卡不起作用

[英]UIB tabset is not working

<div class="ui-tab-container">
    <uib-tabset>
        <uib-tab heading="Region Wise" index="region" active="region_wise">Tab 1</uib-tab >
        <uib-tab heading="Branch Wise" index="branch" active="state_tab">Tab 2</uib-tab>
        <uib-tab heading="City Wise" index="city" active="city_tab">Tab 3</uib-tab>
        <uib-tab heading="Counter Wise" index="counter" active="counter_tab">Tab 4</uib-tab>
    </uib-tabset>
</div>

No tabs are getting displayed and when I switched to bootstrap tabsets they worked fine but I was not able to switch from 1 tab to another on clicking a button on first tab even though I set the active property of that tab to true from inside the function of the button(when clicked) "bootstrap": "~3.3.0" "angular-bootstrap": "~2.3.1" Thanks in advance. 没有显示任何选项卡,当我切换到引导选项卡集时,它们可以正常工作,但是即使我从功能内部将该选项卡的active属性设置为true,也无法在单击第一个选项卡上的按钮时从一个选项卡切换到另一个选项卡按钮的单击(单击时)“ bootstrap”:“〜3.3.0”“ angular-bootstrap”:“〜2.3.1”预先感谢。

Try this 尝试这个

<uib-tabset active="'region'">
    <uib-tab heading="Region Wise" index="'region'" active="region_wise">Tab 1</uib-tab >
    <uib-tab heading="Branch Wise" index="'branch'" active="state_tab">Tab 2</uib-tab>
    <uib-tab heading="City Wise" index="'city'" active="city_tab">Tab 3</uib-tab>
    <uib-tab heading="Counter Wise" index="'counter'" active="counter_tab">Tab 4</uib-tab>
</uib-tabset>

You forget to add the active directive to the uib-tabset and give it a value 您忘记将active指令添加到uib-tabsetuib-tabset赋予一个值

active (Default: Index of first tab) - Active index of tab. active(默认值:第一个标签的索引)-标签的有效索引。 Setting this to an existing tab index will make that tab active. 将其设置为现有的标签索引将使该标签处于活动状态。

Also you didn't instantiated the active values inside your uib-tab elements 另外,您也没有实例化uib-tab元素内的active

Tab index. 标签索引。 Must be unique number or string. 必须是唯一的数字或字符串。

So it should be either like this index="'region'" (note the single apostrophe inside, index expects an expression!!) or index="1" 因此它应该像这个index="'region'" (注意里面的单撇号,index需要一个表达式!)或index="1"

plunk unk

据我了解, ui-tab内部的active指令必须与模型中的一些布尔变量绑定。

<uib-tab ... active="boolean_variable_to_bind">...</uib-tab >

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM