Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何根据ionic 3中的特定页面更改应用程序中的选项卡内容_Html_Angular_Ionic Framework - Fatal编程技术网

Html 如何根据ionic 3中的特定页面更改应用程序中的选项卡内容

Html 如何根据ionic 3中的特定页面更改应用程序中的选项卡内容,html,angular,ionic-framework,Html,Angular,Ionic Framework,我有和离子应用程序,其中有一些网页和2页标签。tab1是整个应用程序中常见的常规选项卡。表2显示了与特定页面内容相关的具体内容。现在,我想知道如何以这样一种方式进行编码:每当用户转到特定页面时,而不是显示tab1,它应该显示tab2。当用户存在该页面时,它应该再次显示tab1。现在我只能显示tab1 this is my tab1 <ion-tabs [selectedIndex]="myIndex" #mytabs> <ion-tab [root]="tab1R

我有和离子应用程序,其中有一些网页和2页标签。tab1是整个应用程序中常见的常规选项卡。表2显示了与特定页面内容相关的具体内容。现在,我想知道如何以这样一种方式进行编码:每当用户转到特定页面时,而不是显示tab1,它应该显示tab2。当用户存在该页面时,它应该再次显示tab1。现在我只能显示tab1

this is my tab1     
<ion-tabs [selectedIndex]="myIndex" #mytabs>
  <ion-tab [root]="tab1Root"  tabIcon="md-home"></ion-tab>
  <ion-tab [root]="tab3Root" tabIcon="md-chatboxes"></ion-tab>
  <ion-tab [root]="tab4Root" tabIcon="md-call"></ion-tab>
  <ion-tab [root]="tab5Root" tabIcon="md-settings"></ion-tab>
</ion-tabs>

this is my tab2
 <ion-tabs [selectedIndex]="myIndex" #myheattabs>
  <ion-tab [root]="tab1Root"  tabIcon="md-home"></ion-tab>
  <ion-tab [root]="tab3Root" tabIcon="md-chatboxes"></ion-tab>
  <ion-tab [root]="tab4Root" tabIcon="md-alert"></ion-tab>
  <ion-tab [root]="tab5Root" tabIcon="md-alert"></ion-tab>
</ion-tabs>

my file.ts
 constructor(private fire: AngularFireAuth, public navCtrl: 
NavController, public navParams: NavParams, public translate: 
TranslateService, public loadingCtrl: LoadingController
,public global: Global, public menu: MenuController, public api: 
ApiProvider, public http: HttpClient, public toastCtrl: ToastController) 
{
    this.tabBarElement = document.querySelector('.tabbar.show-tabbar');
    this.heattabBarElement = document.querySelector('# 
myheattabs.tabbar.show-tabbar')
  }

  //hide tabs 
  ionViewWillEnter() {
    this.tabBarElement.style.display = 'none';
    this.heattabBarElement.style.display = 'block';
    console.log('did eneter');
    this.presentToast2("Please wait while the map is loading");
  }  

  ionViewWillLeave() {   
  this.tabBarElement.style.display = 'flex';
  this.heattabBarElement.style.display = 'none';
  }
这是我的标签1
这是我的表2
我的文件.ts
构造器(私有火灾:AngularFireAuth,公共navCtrl:
导航控制器,公共导航参数:导航参数,公共转换:
TranslateService,公共加载Ctrl:LoadingController
,公共全局:全局,公共菜单:菜单控制器,公共api:
ApiProvider,public http:HttpClient,public-toastCtrl:ToastController)
{
this.tabBarElement=document.querySelector('.tabbar.show tabbar');
this.heattabBarElement=document.querySelector('#
myheattabs.tabbar.show tabbar')
}
//隐藏标签
ionViewWillEnter(){
this.tabBarElement.style.display='none';
this.heattabBarElement.style.display='block';
log('did-eneter');
此.presentToast2(“正在加载地图,请稍候”);
}  
ionViewWillLeave(){
this.tabBarElement.style.display='flex';
this.heattabBarElement.style.display='none';
}

现在我只能在整个应用程序中显示tab1或tab2这是什么意思。。。“当用户存在该页面时,它应该再次显示tab1”?当用户退出时,显示哪个选项卡并不重要,对吗?@Akber很重要。e、 g如果用户访问A页,则应显示tab2,当用户退出该页并返回主页时,应显示Tab1这意味着什么。。。“当用户存在该页面时,它应该再次显示tab1”?当用户退出时,显示哪个选项卡并不重要,对吗?@Akber很重要。e、 g如果用户访问页面A,则应显示tab2,当用户退出页面并返回主页时,应显示tab1