我一直在尝试根据不同的细分加载相同的组件。但是,它总是只需要一个部分。代码如下:
在app.module.ts中,链接定义如下:
links: [
{ component: LoginPage, name: 'LoginPage', segment: 'login' },
{ component: HomePage, name: 'HomePage', segment: 'home' },
{ component: Filter, name: 'ScheduleFilter', segment: 'scheduleFilter' },
{ component: PickPage, name: 'PickPage', segment: 'pick/orders/cold/team/:team/cluster/:cluster' },
{ component: PickPage, name: 'PickPage', segment: 'pick/orders/cold/team//cluster/' },
{ component: PickPage, name: 'PickPage', segment: 'pick/orders/ambient/team/:team' },
{ component: PickPage, name: 'PickPage', segment: 'pick/orders/cold/team/' },
{ component: PickPage, name: 'PickPage', segment: 'pick/baskets/team/' },
{ component: PickPage, name: 'PickPage', segment: 'pick/baskets/team/:team' }
]
并在标签路由部分中,定义如下:
{ title: 'Pick Baskets (Ambient)', icon: 'calendar', segment: '/pick/baskets/team/:team/', component: PickPage },
{ title: 'Pick Orders (Ambient)', icon: 'contacts' , segment: '/pick/orders/ambient/team/:team/', component: PickPage },
{ title: 'Pick Orders (Cold)', icon: 'map', segment: '/pick/orders/cold/team/:team/cluster/:cluster', component: PickPage },
但无论我点击哪个标签,网址最终都是/ pick / baskets / team /:team
我在这里做错了吗?我只是Ionic的新手,无法弄清楚这一点。任何帮助将不胜感激。