我有一个在主元件下创建子管线的routeconfig,我注意到当我使用(通过单击href标签并将routelink设置为子管线)管线链接来访问嵌套管线时,一切都会正常运行,但是当我在子管线上刷新浏览器或直接在浏览器中输入子管线链接时,它无法加载子元件,即仅加载主元件。
带issue的url -localhost:3000/#/dashboard/保留
我的路由配置如下
主应用组件路由至父组件(仪表板)
@RouteConfig([
...
{ path: '/dashboard/...', name: 'Dashboard', component: Dashboard},
...
])
Dashboard component creates child route
@RouteConfig([
{ path: '/reservation', name: 'Reservation', component: Reservation , useAsDefault: true},
]);发布于 2016-04-20 18:23:52
我也遇到过同样的问题,但我通过在index.html.Its的<head>中使用以下代码解决了这个问题,这是APP_BASE_HREF的一个错误
<base href="/">
<!-- Set the base href -->
<script>document.write('<base href="'+ document.location +'"/>');</script>https://stackoverflow.com/questions/36604799
复制相似问题