2017-07-16 103 views
2

我正在使用Ionic CLI v3.5.0和Ionic2 Super Tabs v3.0.2 但是這些選項卡顯示不正常。點擊標籤後,頁面發生變化,但不顯示。 Ionic 2 Super Tabs在瀏覽器中無法正常顯示

這是我的app.module.ts。我已經添加了SuperTabsModule.forRoot(),如文檔中所示。

import { BrowserModule } from '@angular/platform-browser'; 
import { ErrorHandler, NgModule } from '@angular/core'; 
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular'; 
import { SplashScreen } from '@ionic-native/splash-screen'; 
import { StatusBar } from '@ionic-native/status-bar'; 
import { SuperTabsController} from 'ionic2-super-tabs'; 



import { MyApp } from './app.component'; 
import { ExplorePage } from '../pages/explore/explore'; 
import { SuperTabsModule } from 'ionic2-super-tabs'; 
import { CoachingsPage } from '../pages/coachings/coachings'; 
import { TutorsPage } from '../pages/tutors/tutors'; 


@NgModule({ 
    declarations: [ 
    MyApp, 
    ExplorePage, 
    CoachingsPage, 
    TutorsPage 
    ], 
    imports: [ 
    BrowserModule, 
    IonicModule.forRoot(MyApp), 
    SuperTabsModule.forRoot(), 
    ], 
    bootstrap: [IonicApp], 
    entryComponents: [ 
    MyApp, 
    ExplorePage, 
    CoachingsPage, 
    TutorsPage 
    ], 
    providers: [ 
    StatusBar, 
    SplashScreen, 
    {provide: ErrorHandler, useClass: IonicErrorHandler} 
    ] 
}) 
export class AppModule {} 

這是我的tab.ts文件。在這裏我的頁面不使用延遲加載,所以我沒有在這裏添加SuperTabsModule。我已經添加了它,但沒有奏效。

import { Component } from '@angular/core'; 
import { IonicPage, NavController, NavParams } from 'ionic-angular'; 
import { CoachingsPage } from '../coachings/coachings'; 
import { TutorsPage } from '../tutors/tutors'; 


/** 
* Generated class for the ExplorePage page. 
* 
* See http://ionicframework.com/docs/components/#navigation for more info 
* on Ionic pages and navigation. 
*/ 
@IonicPage() 
@Component({ 
    selector: 'page-explore', 
    templateUrl: 'explore.html', 
}) 
export class ExplorePage { 

    tab1Root:any = CoachingsPage; 
    tab2Root:any = TutorsPage; 

    constructor(public navCtrl: NavController, public navParams: NavParams) { 
    } 

    ionViewDidLoad() { 
    console.log('ionViewDidLoad ExplorePage'); 
    } 

} 

這裏的tabs.html文件:

<super-tabs> 
<super-tab [root]="tab1Root" title="Top Tutors"></super-tab> 
<super-tab [root]="tab2Root" title="Top Coaching"></super-tab> 
</super-tabs> 

回答

0

它已經有一段時間,但我有同樣的問題,你有,我終於發現超級CSS標籤未加載。 您可以嘗試檢索CSS並將其放入您的某個文件中作爲測​​試。

相關問題