【问题标题】:Ionic 2 Super Tabs not showing properly in browsersIonic 2 Super Tabs 无法在浏览器中正确显示
【发布时间】:2017-12-20 21:34:37
【问题描述】:

我正在使用 Ionic CLI v3.5.0 和 Ionic2 Super Tabs v3.0.2 但是选项卡显示不正确。单击选项卡时,页面会更改,但不会显示。

这是我的 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>

【问题讨论】:

    标签: ionic2 ionic-tabs


    【解决方案1】:

    已经有一段时间了,但我遇到了同样的问题,我终于发现超级标签 CSS 没有加载。 您可以尝试检索 CSS 并将其放入您的一个文件中作为测​​试。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-06-12
      • 1970-01-01
      • 2014-09-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-30
      相关资源
      最近更新 更多