Ionic: Error: Cannot match any routes. URL Segment:
Ionic: Error: Cannot match any routes. URL Segment:
我正在尝试创建一个相对基本的 Ionic 应用程序,但出现错误:
core.js:14597 ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'match-details/match-details-info'
Error: Cannot match any routes. URL Segment: 'match-details/match-details-info'
at ApplyRedirects.push../node_modules/@angular/router/fesm5/router.js.ApplyRedirects.noMatchError (router.js:2469)
我想做的是点击常规页面上的按钮移动到另一个页面上有标签的页面。
我正在从 http://localhost:8100/tabs/fixtures to what I would expect to be http://localhost:8100/match-details/match-info 移动,但我收到了上述错误,我留在了原始页面上。
这是我的 app-routing.module.ts 文件的一部分,显示了 match-details 路径(第 3 行):
const routes: Routes = [
{ path: '', loadChildren: './tabs/tabs.module#TabsPageModule' },
{ path: 'match-details', loadChildren: './pages/match-details/match-details.module#MatchDetailsPageModule' },
{ path: 'match-details-standard/:id', loadChildren: './pages/match-details-standard/match-details-standard.module#MatchDetailsStandardPageModule' },
{ path: 'player-details/:id', loadChildren: './pages/player-details/player-details.module#PlayerDetailsPageModule' },
这是我的比赛详情-routing.module.ts:
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { MatchDetailsPage } from './match-details.page';
const routes: Routes = [
{
path: 'match-details',
component: MatchDetailsPage,
children: [
{
path: 'match-details-info',
children: [
{
path: '',
loadChildren: '../match-details-info/match-details-info.module#MatchDetailsInfoPageModule'
}
]
},
{
path: 'match-details-lineup',
children: [
{
path: '',
loadChildren: '../match-details-lineup/match-details-lineup.module#MatchDetailsLineupPageModule'
}
]
},
{
path: '',
redirectTo: '/match-details/match-details-info',
pathMatch: 'full'
}
]
},
{
path: '',
redirectTo: '/match-details/match-details-info',
pathMatch: 'full'
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class MatchDetailsPageRoutingModule {}
快把我逼疯了!!!!!!!!!
据我所知,您的路线设置方式是 match-details/match-details/match-details-info
,因为两条路线路径都包括 match-details
尝试如下更改 match-details-routing.module.ts
中的路线
const routes: Routes = [
{
path: '',
component: MatchDetailsPage,
children: [
{
path: 'match-details-info',
children: [
{
path: '',
loadChildren: '../match-details-info/match-details-info.module#MatchDetailsInfoPageModule'
}
]
},
{
path: 'match-details-lineup',
children: [
{
path: '',
loadChildren: '../match-details-lineup/match-details-lineup.module#MatchDetailsLineupPageModule'
}
]
},
{
path: '',
redirectTo: '/match-details/match-details-info',
pathMatch: 'full'
}
]
}
];
我正在尝试创建一个相对基本的 Ionic 应用程序,但出现错误:
core.js:14597 ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'match-details/match-details-info'
Error: Cannot match any routes. URL Segment: 'match-details/match-details-info'
at ApplyRedirects.push../node_modules/@angular/router/fesm5/router.js.ApplyRedirects.noMatchError (router.js:2469)
我想做的是点击常规页面上的按钮移动到另一个页面上有标签的页面。
我正在从 http://localhost:8100/tabs/fixtures to what I would expect to be http://localhost:8100/match-details/match-info 移动,但我收到了上述错误,我留在了原始页面上。
这是我的 app-routing.module.ts 文件的一部分,显示了 match-details 路径(第 3 行):
const routes: Routes = [
{ path: '', loadChildren: './tabs/tabs.module#TabsPageModule' },
{ path: 'match-details', loadChildren: './pages/match-details/match-details.module#MatchDetailsPageModule' },
{ path: 'match-details-standard/:id', loadChildren: './pages/match-details-standard/match-details-standard.module#MatchDetailsStandardPageModule' },
{ path: 'player-details/:id', loadChildren: './pages/player-details/player-details.module#PlayerDetailsPageModule' },
这是我的比赛详情-routing.module.ts:
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { MatchDetailsPage } from './match-details.page';
const routes: Routes = [
{
path: 'match-details',
component: MatchDetailsPage,
children: [
{
path: 'match-details-info',
children: [
{
path: '',
loadChildren: '../match-details-info/match-details-info.module#MatchDetailsInfoPageModule'
}
]
},
{
path: 'match-details-lineup',
children: [
{
path: '',
loadChildren: '../match-details-lineup/match-details-lineup.module#MatchDetailsLineupPageModule'
}
]
},
{
path: '',
redirectTo: '/match-details/match-details-info',
pathMatch: 'full'
}
]
},
{
path: '',
redirectTo: '/match-details/match-details-info',
pathMatch: 'full'
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class MatchDetailsPageRoutingModule {}
快把我逼疯了!!!!!!!!!
据我所知,您的路线设置方式是 match-details/match-details/match-details-info
,因为两条路线路径都包括 match-details
尝试如下更改 match-details-routing.module.ts
中的路线
const routes: Routes = [
{
path: '',
component: MatchDetailsPage,
children: [
{
path: 'match-details-info',
children: [
{
path: '',
loadChildren: '../match-details-info/match-details-info.module#MatchDetailsInfoPageModule'
}
]
},
{
path: 'match-details-lineup',
children: [
{
path: '',
loadChildren: '../match-details-lineup/match-details-lineup.module#MatchDetailsLineupPageModule'
}
]
},
{
path: '',
redirectTo: '/match-details/match-details-info',
pathMatch: 'full'
}
]
}
];