Ionic4.x 创建页面以及页面跳转

创建页面:

1、cd 到项目目录 
2、通过ionic g page 页面名称 
3、创建完成组件以后会在 src 目录下面多一个 button 的目录,它既是一个页面也是一个 模块。
4、如果我们想在 tab1 里面写一个按钮点击跳转到 button 页面的话我们可以通过使用 Angular 的路由跳转。在 ionic4.x 中路由是完全基于 angular,用法几乎和 angular 一样。
5、ionic4.x 中跳转到其他页面不会默认加返回按钮,如果我们想给 button 页面加返回的话 需要找到 button 对应的 button.page.html,然后在再头部加入 ion-back-button。
<ion-header>
  <ion-toolbar>
    <ion-title>
      Tab One
    </ion-title>
  </ion-toolbar>
</ion-header>

<ion-content>
   
  <ion-button color="primary" [routerLink]="[ '/button' ]">  跳转到按钮组件页面 </ion-button>
</ion-content>
原文地址:https://www.cnblogs.com/loaderman/p/10945102.html