Art*_*aim 3 javascript typescript ionic-framework ionic2
我有我的ionicbootstrap配置:
{
mode: 'md',
tabsHideOnSubPages: true
}
Run Code Online (Sandbox Code Playgroud)
在我的设置上,但在某些子页面上显示标签.这似乎是一种随机行为.这是正确的做法吗?
离子:2.0.0@beta.11
谢谢阿图尔
#编辑:
我正在使用此修复程序使标签消失:
ionViewWillEnter() {
let tabs = document.querySelectorAll('.show-tabbar');
if (tabs !== null) {
Object.keys(tabs).map((key) => {
tabs[key].style.transform = 'translateY(56px)';
});
} // end if
}
ionViewDidLeave() {
let tabs = document.querySelectorAll('.show-tabbar');
if (tabs !== null) {
Object.keys(tabs).map((key) => {
tabs[key].style.transform = 'translateY(0)';
});
} // end if
}
Run Code Online (Sandbox Code Playgroud)
但必须是一个糟糕的方式.这样做的简单方法是什么?
2017答案
基于Ionic文档,您只需添加tabsHideOnSubPages: true到您的应用程序Ionic配置,如下所示:
app.module.ts
imports: [
BrowserModule,
IonicModule.forRoot(AppComponent, {
tabsHideOnSubPages: true
})
]
Run Code Online (Sandbox Code Playgroud)