有没有办法设置类似于 Durandal 的路由器的根路径?
这就是我想要做的:
this.router.configure(config => {
config.title = 'Aurelia';
config.options.pushState = true;
config.options.root = '/root';
config.map([
{ route: ['','welcome'], moduleId: './welcome', nav: true, title:'Welcome' }
]);
});
这样 urlhttp://example.com/root
映射到welcome
模块。
编辑:我刚刚意识到代码按预期工作。其他原因导致了问题。无论如何,应该将根属性添加到文档中。我只知道这件事,因为我以前和 Durandal 一起工作过。