【问题标题】:Ionic home page redirect is not working离子主页重定向不起作用
【发布时间】:2018-08-28 19:05:55
【问题描述】:

代码:

<ion-segment [(ngModel)]="segment" color="primary">
    <ion-segment-button value="Home" (click)="page_redirect('HomePage')" text-center> Home </ion-segment-button>
    <ion-segment-button value="Featured" (click)="page_redirect('FeaturedItemPage')" text-center> Featured </ion-segment-button>
    <ion-segment-button value="Category" (click)="page_redirect('CategoriesPage')" text-center> Category </ion-segment-button>
    <ion-segment-button value="User" user text-center> User </ion-segment-button>
</ion-segment>

page_redirect 函数:

page_redirect(page){
    this.navCtrl.push(page);
}

错误:

未捕获(承诺):无效链接:主页

谁能告诉我为什么离子主页重定向不起作用? CategoriesPageFeaturedItemPage 重定向就像一个魅力。

【问题讨论】:

  • 您是否使用延迟加载...如果可能,请显示代码 app.module.ts 和 homepage.ts
  • 发布你的 ts 页面

标签: angular typescript ionic-framework ionic2 ionic3


【解决方案1】:

这有时会发生在我身上。使用“ionic serve”停止和启动服务器似乎可以解决问题。

只是为了确保检查您的页面名称是否与 HomePage

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-03-08
    • 1970-01-01
    • 2019-07-06
    • 1970-01-01
    • 2018-08-16
    • 1970-01-01
    相关资源
    最近更新 更多