0

我正在使用这个https://www.nativescript.org/blog/implementing-a-login-for-nativescript-apps-with-tab-based-navigation)git(https://github.com/NativeScript/login -标签导航-ng )

应用程序路由.module.ts

const routes: Routes = [
{ 
    path: "", 
    redirectTo: "/tabs/default",         
    pathMatch: "full" 
},
{
    path: "login", 
    component: LoginComponent
},    
{
    path: "tabs",
    loadChildren: "~/app/tabs/tabs.module#TabsModule",
    canActivate: [AuthGuard]
},

];

tabs.module.ts

NativeScriptRouterModule.forChild([
        {
            path: "default", component: TabsComponent, children: [
                {
                    path: "events",
                    outlet: "eventTab",
                    component: NSEmptyOutletComponent,
                    loadChildren: "~/app/event/events.module#EventsModule",
                },
                {
                    path: "notifications",
                    outlet: "notificationTab",
                    component: NSEmptyOutletComponent,
                    loadChildren: "~/app/notifications/notifications.module#NotificationsModule",
                },
                {
                    path: "profile",
                    outlet: "profileTab",
                    component: NSEmptyOutletComponent,
                    loadChildren: "~/app/profile/profile.module#ProfileModule",
                },
                {
                    path: "info",
                    outlet: "infoTab",
                    component: NSEmptyOutletComponent,
                    loadChildren: "~/app/info/info.module#InfoModule",
                }                    
            ]
        }
    ])

通知.module.ts

NativeScriptRouterModule.forChild([
        { path: "", redirectTo: "notifications" },
        { path: "notifications", component: NotificationsComponent },           
    ]),

在通知视图中,我有记录列表,当我单击要重定向到事件选项卡的记录时。我尝试了很多方法,但没有任何效果:(

例如,有了这个我没有错误,但重定向也不起作用

this.routerExtensions.navigate([
    'tabs/default', { outlets: { eventTab: ["events"] } }
  ])

你有什么想法?

4

0 回答 0