Ionic 4路由无法正常工作,但更改了URL,但没有出现视图

问题描述 投票:2回答:1

我正在开发Ionic 4应用程序,我有两个页面的身份验证和注册,我在“ app-routing.module”中添加了路由,将Authentication组件设置为root组件,因此,当我单击查看路线更改,并且不会显示注册视图:

App-routing.module

const routes: Routes = [
   { path: '', redirectTo: 'auth', pathMatch: 'full' },
  { path: 'auth', component: AuthenticationComponent },
  { path: 'registerFirst', component: RegistrationComponent},
];
  ...

这是认证视图内的按钮

<ion-button expand="full" color="medium" [routerLink]="['/registerFirst']">CREATE AN 
 ACCOUNT</ion-button>
routing ionic4
1个回答
2
投票

像这样更改路由:

© www.soinside.com 2019 - 2024. All rights reserved.