使用pushState时设置Aurelia路由器的根
有没有类似于Durandal设置路由器根路径的方法 这就是我想做的:使用pushState时设置Aurelia路由器的根,aurelia,Aurelia,有没有类似于Durandal设置路由器根路径的方法 这就是我想做的: this.router.configure(config => { config.title = 'Aurelia'; config.options.pushState = true; config.options.root = '/root'; config.map([ { route: ['','welcome'], moduleId: './welcome', nav: true
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
映射到欢迎
模块
编辑:我刚刚意识到代码按预期工作。是其他原因造成了这个问题。无论如何,应该将root属性添加到文档中。我只知道这一点,因为我以前与Durandal合作过。您可以尝试在html文件头中设置一个基本标记
您能在路由器存储库中打开一个问题吗?您解决了这个问题吗?