Angular 如何防止Ionic在每次刷新页面时导航到第一页
我正在使用Ionic 3+Angular并处理Angular 如何防止Ionic在每次刷新页面时导航到第一页,angular,ionic3,deep-linking,Angular,Ionic3,Deep Linking,我正在使用Ionic 3+Angular并处理Deeplinks。 我已配置以下路由: IonicModule.forRoot( App, { locationStrategy: 'hash' }, { links: [ { component: ReportPage, segment: "report/:locationId/:itemId" },
Deeplinks
。
我已配置以下路由:
IonicModule.forRoot(
App,
{ locationStrategy: 'hash' },
{
links: [
{
component: ReportPage,
segment: "report/:locationId/:itemId"
},
{
component: HomePage,
segment: "home/:locationId/:itemId"
},
]
}
)
如果我点击主页/1/2
,它会按预期将我重定向到主页。
如果我点击report/1/2
,它会按预期将我重定向到报告页面
但当我点击home/1/2
并控制刷新页面时,问题就出现了,它会将我导航到报告页面
我尝试使用ionicPage段,但没有成功
提前感谢。如果您可以在链接对象中设置名称,它将起作用,如:
links: [
{
component: HomePage,
segment: "home/:locationId/:itemId",
name: 'home',
},
{
component: ReportPage,
name: 'report',
segment: "report/:locationId/:itemId"
},
]