Ember.js 如何在不更改Ember中的URL的情况下将路由放入子文件夹
我有目前在我的主要路径中的链接。我想在不更改URL的情况下将它们分组到子文件夹中。例如,我有Ember.js 如何在不更改Ember中的URL的情况下将路由放入子文件夹,ember.js,Ember.js,我有目前在我的主要路径中的链接。我想在不更改URL的情况下将它们分组到子文件夹中。例如,我有/income statement,我想把文件放在报告目录中。使用嵌套路由时,url变为/reports/income statement。我尝试将报表级别上的路径设置为{path:'},但它与我的主路径冲突 this.route('reports', function() { this.route('accounts-receivable') this.route('income-stateme
/income statement
,我想把文件放在报告目录中。使用嵌套路由时,url变为/reports/income statement
。我尝试将报表级别上的路径设置为{path:'}
,但它与我的主路径冲突
this.route('reports', function() {
this.route('accounts-receivable')
this.route('income-statement')
})
我发现我可以通过在路径的开头添加
。/
来实现这一点
this.route('reports', function() {
this.route('accounts-receivable', {path: '../accounts-receivable'})
this.route('income-statement', {path: '../income-statement'})
})
将组路由的路径指定为
/
:
this.route('reports', { path: '/' }, function() {
this.route('accounts-receivable')
this.route('income-statement')
});
这也会导致与主路线的冲突