【发布时间】:2017-09-18 17:09:25
【问题描述】:
我正在寻找一种方法来为移动和桌面分辨率提供不同的路由。我有材料详细信息页面布局。因此,当用户移动到移动设备时,用户应该会看到主列表,并且当用户单击列表中的项目时,它应该导航到详细信息页面。我认为会有 2 组用于桌面和移动设备的路线,我需要根据宽度加载正确的路线配置。
请提出建议。
对于桌面:
const appDesktopRoutes:Routes =[
{
path: '',
component: ItemListComponent,
children: [
{
path: 'item/:id',
component: ItemDetailsComponent
}
]
}]
对于手机:
const appMobileRoutes:Routes =[
{
path: '',
component: ItemListComponent,
},
{
path: 'item/:id',
component: ItemDetailsComponent
}
]
【问题讨论】:
-
更新的解决方案对您有用吗?