Aurelia 路线不';直接在浏览器上键入时无法工作
当我们直接在浏览器上键入Aurelia路由时,为什么它不起作用?我已将Aurelia配置为从URL中删除“#”。当点击网站中的链接时,它工作得很好,但当我试图直接在浏览器上键入URL时,它只与“#”一起工作 情况就是这样: 带有网站链接 localhost/#/route->works 本地主机/路由->工作 在浏览器上键入 localhost/#/route->works localhost/route->不工作 这是我的配置:Aurelia 路线不';直接在浏览器上键入时无法工作,aurelia,Aurelia,当我们直接在浏览器上键入Aurelia路由时,为什么它不起作用?我已将Aurelia配置为从URL中删除“#”。当点击网站中的链接时,它工作得很好,但当我试图直接在浏览器上键入URL时,它只与“#”一起工作 情况就是这样: 带有网站链接 localhost/#/route->works 本地主机/路由->工作 在浏览器上键入 localhost/#/route->works localhost/route->不工作 这是我的配置: configureRouter(config, router){
configureRouter(config, router){
config.title = 'Dreampper';
router.baseUrl = "/";
config.options.pushState = true;
var navStrat = (instruction) => {
instruction.config.moduleId = instruction.fragment
instruction.config.href = instruction.fragment
}
config.map([
{ route: 'login', moduleId: './components/account/login', name: 'login', nav: true},
{ route: 'register', moduleId: './components/account/register', name: 'register'},
{ route: '', moduleId: './components/timeline/timeline', name: 'timeline', title: 'Timeline' },
{ route: 'welcome', moduleId: './components/account/welcome', name: 'welcome' },
{ route: ':username', moduleId: './components/profile/profile', name: 'profile', nav: false }
]);
this.router = router;
}
我在index.html上有
有人可以帮我吗?PushState导航需要服务器端配置。您必须正确配置服务器。请参见上的第二个黄色框,状态导航需要服务器端配置。您必须正确配置服务器。请参见第二个黄色框