我的路线如下
path: '',
component: FullLayoutComponent,
children: [
{
path: 'testGame',
component:TestGame,
children:[{path:'list',component: ListTestGame},
{path:'crud',component: CrudTestGame}
]
},
当我使用下面的列表时,一切正常。
<li class="nav-item">
<a class="nav-link" routerLinkActive="active" [routerLink]="['/testGame/list']"><i class="icon-game-controller"></i> baran</a>
</li>
但是当我在浏览器中键入相同的URL时,它会失败。谁能告诉我为什么会这样?当我使用HashLocationStrategy似乎没有问题时,它只发生在PathLocationStrategy
Failed to load resource: the server responded with a status of 404 (Not Found)
simple-line-icons.css Failed to load resource: the server responded with a status of 404 (Not Found)
simroll.css Failed to load resource: the server responded with a status of 404 (Not Found)
inline.bundle.js Failed to load resource: the server responded with a status of 404 (Not Found)
polyfills.bundle.js Failed to load resource: the server responded with a status of 404 (Not Found)
styles.bundle.js Failed to load resource: the server responded with a status of 404 (Not Found)
vendor.bundle.js Failed to load resource: the server responded with a status of 404 (Not Found)
main.bundle.js Failed to load resource: the server responded with a status of 404 (Not Found)
scripts.bundle.js Failed to load resource: the server responded with a status of 404 (Not Found)
styles.bundle.js Failed to load resource: the server responded with a status of 404 (Not Found)
vendor.bundle.js Failed to load resource: the server responded with a status of 404 (Not Found)
main.bundle.js Failed to load resource: the server responded with a status of 404 (Not Found)
font-awesome.min.css Failed to load resource: the server responded with a status of 404 (Not Found)
simple-line-icons.css Failed to load resource: the server responded with a status of 404 (Not Found)