Ionic2 如何隐藏侧菜单栏同一页的菜单项。在离子2中
在app.component.ts中,我添加了菜单项的所有页面,当主页打开时,我想从侧菜单栏隐藏主菜单项,所有页面都是如此。我试图使用类名来隐藏,但它会影响所有的菜单项css。请给我解决方案:Ionic2 如何隐藏侧菜单栏同一页的菜单项。在离子2中,ionic2,angular2-template,angular2-directives,Ionic2,Angular2 Template,Angular2 Directives,在app.component.ts中,我添加了菜单项的所有页面,当主页打开时,我想从侧菜单栏隐藏主菜单项,所有页面都是如此。我试图使用类名来隐藏,但它会影响所有的菜单项css。请给我解决方案: constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen) { this.initializeApp(); this.pages =
constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen) {
this.initializeApp();
this.pages = [
{ title: 'Home', component: HomePage, icon:'home' },
{ title: 'Order History', component: OrderHistory, icon:'timer' },
{ title: 'Profile', component: Profile, icon:'person' }
];
}
openPage(page) {
console.log("open Menu");
// Reset the content nav to have just this page
// we wouldn't want the back button to show in this scenario
this.nav.setRoot(page.component);
}