Angular 6 使用 Angular Material,显示列表,使用选项卡进入项目详细信息“页面”。
我的路线很简单:
{
path: '', component: CurrenciesComponent
}
我尝试了这样的事情:
{
path: 'currencies',
canActivate: [AuthGuard],
component: CurrenciesComponent,
children: [
{ path: 'currencies/:id', component: CurrenciesDetailComponent }
]
}
我寻找解决方案,但没有解决它。也许使用 Material 选项卡无法实现这一点?
最佳答案
要将选项卡模式与路由结合使用,请使用 mat-tab-nav-bar
和 mat-tab-link
指令。关于此的文档并不多:https://material.angular.io/components/tabs/overview#tabs-and-navigation .
关于angular - 一种使用 Angular Material Tab 更新 Url 的方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51205559/