我有以下路线:
const routes: Routes = [
{
path: '',
component: BlogLayoutComponent,
children: [
{
path: ':pageNumber',
component: HomeComponent
},
{
path: '',
component: HomeComponent
},
{
path: 'article/:id',
component: ArticleComponent
},
{
path: 'articles-by-hashtag/:id',
component: ArticlesByHashComponent
},
{
path: 'articles-by-category/:id',
component: ArticlesByCatComponent
},
{
path: 'about-me',
component: AboutMeComponent
}
]
}
];
about-me
页面使用
routerLink
像这样:
<li><a [routerLink]="[ 'about-me' ]">ABOUT ME</a></li>
如果我删除默认参数
:pageNumber
然后导航工作,否则
关于我
关于我
路线作业?我宁愿不用
router.navigate(...
说实话。