作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当我尝试以下操作时:
const routes: Routes = [
{
path: "", component: RegisteredLayoutComponent, canActivate: [AuthGuard], children: [
{
path: '',
redirectTo:
"/(topicsTab:topicsPage//newsTab:newsPage//homeTab:homePage//askTab:askPage//moreTab:morePage)",
pathMatch: "full"
},
{ path: 'home', component: HomePageComponent, outlet: "homeTab" },...
{ path: '**', redirectTo: '' }
<BottomNavigation selectedIndex="2">
<TabStrip backgroundColor="white">
<TabStripItem>
<Label text="Topics" class="icon__color"></Label>
<Image src="~/assets/round_people_black_18dp.png" class="fas t-36 icon__color"></Image>
</TabStripItem>
<TabStripItem class="special">
<Label text="News" class="icon__color"></Label>
<Image src="~/assets/round_local_library_black_18dp.png" class="fas t-36 icon__color"></Image>
</TabStripItem>
<TabStripItem class="special">
<Label text="Home" class="icon__color"></Label>
<Image src="~/assets/round_home_black_18dp.png" class="fas t-36 icon__color"></Image>
</TabStripItem>
<TabStripItem class="special">
<Label text="Ask?" class="icon__color"></Label>
<Image src="~/assets/round_contact_support_black_18dp.png" class="fas t-36 "></Image>
</TabStripItem>
<TabStripItem class="special">
<Label text="More" class="icon__color"></Label>
<Image src="~/assets/round_more_horiz_black_18dp.png" class="fas t-36 icon__color"></Image>
</TabStripItem>
</TabStrip>
<!-- The number of TabContentItem components should corespond to the number of TabStripItem components -->
<TabContentItem>
<page-router-outlet name="topicsTab"></page-router-outlet>
</TabContentItem>
<TabContentItem>
<page-router-outlet name="newsTab"></page-router-outlet>
</TabContentItem>
<TabContentItem>
<page-router-outlet name="homeTab"></page-router-outlet>
</TabContentItem>
<TabContentItem>
<page-router-outlet name="askTab"></page-router-outlet>
</TabContentItem>
<TabContentItem>
<page-router-outlet name="moreTab"></page-router-outlet>
</TabContentItem>
</BottomNavigation>
最佳答案
我明白了 :-) 真正帮助我找到正确路线的是启用跟踪,如下所示:
@NgModule({
imports: [NativeScriptRouterModule.forRoot(routes, { enableTracing: true })],
exports: [NativeScriptRouterModule]
const routes: Routes = [
{ path: '', redirectTo: 'registeredRoute', pathMatch: 'full' },
{
path: "registeredRoute", component: RegisteredLayoutComponent, canActivate: [AuthGuard], children: [
{ path: "", component: HomeComponent, outlet: "homeTab" },
{ path: "homePage", component: HomeComponent, outlet: "homeTab" },
{ path: "topicsPage", component: TopicsComponent, outlet: "topicsTab" },
{ path: "newsPage", component: NewsComponent, outlet: "newsTab" },
{ path: "askPage", component: AskComponent, outlet: "askTab" },
{ path: "morePage", component: MoreComponent, outlet: "moreTab" }
]
},
{
path: "", component: UnregisteredLayoutComponent, children: [
{ path: '', redirectTo: 'loginPage', pathMatch: 'full' },
{ path: "loginPage", component: LoginComponent }
]
,
},
{ path: '**', redirectTo: '', pathMatch: 'full' }
关于angular - 带有标签/路由器 socket 的子路由不起作用。 "Error: Cannot match any routes. URL Segment",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60348070/
我是一名优秀的程序员,十分优秀!