微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Nativescript Angular BottomNavigation选项卡未加载命名路由器出口

如何解决Nativescript Angular BottomNavigation选项卡未加载命名路由器出口

使用底部导航实现,它不起作用,但是也没有错误

路由module.ts

export const routes: Routes = [    
    {    
      path: '',redirectTo: 'login',pathMatch: 'full',},{    
      path: 'login',component: LoginComponent,data: {    
        title: 'Login Page'    
      }    
    },{    
      path: 'Dashboard',component: DashboardComponent,data: {    
        title: 'Dashboard Page',requiresLogin: true
      },canActivate:[LoginGuardGuard]   
    },{    
      path: 'capture',component: CaptureComponent,data: {    
        title: 'capture',canActivate:[LoginGuardGuard],outlet: "capture"
    }   
];    

app.component.html

<page-router-outlet></page-router-outlet>

dashboard.component.html

<BottomNavigation selectedindex="0">

  <!-- The bottom tab UI is created via TabStrip (the containier) and TabStripItem (for each tab)-->
  <TabStrip>
    <TabStripItem>
      <Label text="Home"></Label>
      <Image src="font://&#xf015;" class="fas"></Image>
    </TabStripItem>
    <TabStripItem class="special">
      <Label text="Camera"></Label>
      <Image src="font://&#xf007;" class="fas"></Image>
    </TabStripItem>
    <TabStripItem class="special">
      <Label text="Account"></Label>
      <Image src="font://&#xf007;" class="fas"></Image>
    </TabStripItem>
    <TabStripItem class="special">
      <Label text="Search"></Label>
      <Image src="font://&#xf00e;" class="fas"></Image>
    </TabStripItem>
  </TabStrip>

  <!-- The number of TabContentItem components should corespond to the number of TabStripItem components -->
  <TabContentItem>
 <StackLayout>
      <router-outlet name="search"></router-outlet>
    </StackLayout>
  </TabContentItem>
  <TabContentItem>
    <StackLayout>
 <router-outlet name="capture"></router-outlet> 

    </StackLayout>
  </TabContentItem>
  <TabContentItem>
    <StackLayout>
      <router-outlet name="capture"></router-outlet>
    </StackLayout>
  </TabContentItem>
  <TabContentItem>

    <page-router-outlet name="capture"></page-router-outlet>
  </TabContentItem>

</BottomNavigation>

它不会加载组件。任何建议都会有所帮助。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。