mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 11:41:20 +08:00
fix(tab-button): add a class to hide the tab when show is false
This commit is contained in:
@ -1,9 +1,10 @@
|
||||
@import "../../themes/ionic.globals";
|
||||
|
||||
:host {
|
||||
@include margin(0);
|
||||
text-align: center;
|
||||
@include border-radius(0);
|
||||
@include margin(0);
|
||||
|
||||
text-align: center;
|
||||
|
||||
box-sizing: border-box;
|
||||
|
||||
@ -42,6 +43,10 @@
|
||||
color: var(--color-selected);
|
||||
}
|
||||
|
||||
:host(.tab-hidden) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
@ -74,9 +74,9 @@ export class TabButton {
|
||||
'role': 'tab',
|
||||
'id': tab.btnId,
|
||||
'aria-selected': selected,
|
||||
'hidden': !tab.show,
|
||||
class: {
|
||||
...createColorClasses(this.color),
|
||||
'tab-hidden': !tab.show,
|
||||
'tab-selected': selected,
|
||||
'has-label': hasLabel,
|
||||
'has-icon': hasIcon,
|
||||
|
@ -14,7 +14,6 @@
|
||||
<ion-app>
|
||||
<ion-tabs>
|
||||
<ion-tab label="Plain List" icon="star">
|
||||
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>Tab One</ion-title>
|
||||
@ -23,11 +22,9 @@
|
||||
<ion-content padding>
|
||||
Tab One
|
||||
</ion-content>
|
||||
|
||||
</ion-tab>
|
||||
|
||||
<ion-tab label="Schedule" icon="globe">
|
||||
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>Tab Two</ion-title>
|
||||
@ -36,11 +33,9 @@
|
||||
<ion-content padding>
|
||||
Tab Two
|
||||
</ion-content>
|
||||
|
||||
</ion-tab>
|
||||
|
||||
<ion-tab label="Stopwatch" icon="logo-facebook">
|
||||
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>Tab Three</ion-title>
|
||||
@ -49,7 +44,17 @@
|
||||
<ion-content padding>
|
||||
Tab Three
|
||||
</ion-content>
|
||||
</ion-tab>
|
||||
|
||||
<ion-tab id="hiddenTab" label="Hidden" icon="alert" show="false">
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>Hidden Tab</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
<ion-content padding>
|
||||
Hidden Tab
|
||||
</ion-content>
|
||||
</ion-tab>
|
||||
|
||||
<ion-tab disabled label="Messages" icon="chatboxes" component="page-one">
|
||||
|
Reference in New Issue
Block a user