Javascript Aurelia命名路由器视图/视口不工作
我无法使布局视图正确填充我在路由配置中指定的视图端口。我有一个路由“styleguide”,它应该使用“sidebar”布局,用“sidebar.html”填充“sidebar”路由器视图,用“content.ts/html”填充“content”路由器视图 应用程序tsJavascript Aurelia命名路由器视图/视口不工作,javascript,aurelia,Javascript,Aurelia,我无法使布局视图正确填充我在路由配置中指定的视图端口。我有一个路由“styleguide”,它应该使用“sidebar”布局,用“sidebar.html”填充“sidebar”路由器视图,用“content.ts/html”填充“content”路由器视图 应用程序ts export class App { configureRouter(config: RouterConfiguration, router: Router) { config.map([{ rout
export class App {
configureRouter(config: RouterConfiguration, router: Router) {
config.map([{
route: "styleguide",
name: "styleguide",
layoutView: "layout/sidebar.html",
viewPorts: {
sidebar: { moduleId: "styleguide/sidebar.html" },
content: { moduleId: "styleguide/index" },
}
}]);
}
}
export class Index { }
app.html
<template>
<router-view layout-view="layout/default.html"></router-view>
</template>
<template>
<router-view name="sidebar"></router-view>
<router-view name="content"></router-view>
</template>
<template>
SIDEBAR!!
</template>
<template>
CONTENT
</template>
styleguide/index.html
<template>
<router-view layout-view="layout/default.html"></router-view>
</template>
<template>
<router-view name="sidebar"></router-view>
<router-view name="content"></router-view>
</template>
<template>
SIDEBAR!!
</template>
<template>
CONTENT
</template>
内容
问题:
- “在styleguide/sidebar.html的视图中找不到路由器视图。”--尽管我已经指定了路由器视图名称等
- 我有另一条路线,它没有指定
,因此使用默认路线。这仅在我将layout/default.html中的布局视图
元素替换为路由器视图
时有效。我试图在两种布局中都使用插槽,但侧边栏布局给了我相同的错误插槽
应用程序。html
不支持视口。只有一个具有默认名称的
,因此,对于具有2个视口的管线配置,由于上述错误,该配置失败
根据文档,布局似乎是实现路线槽状行为的一种方式,而不是放置
的地方。您如何使用不同的关闭标记关闭?我认为老虎机有不同的开放标签。请检查这份文件,这是一个打字错误-谢谢。我也读过该文件和其他相关文件,我觉得这应该是根据我所读的工作。