Ember.js EmberJS嵌套子例程自定义索引路径未按预期工作

Ember.js EmberJS嵌套子例程自定义索引路径未按预期工作,ember.js,ember-router,Ember.js,Ember Router,我正在遵循(v2.14.0),我正在尝试设置一个嵌套的子路由,其中索引路由应该重定向到不同的子例程 Router.map(function() { this.route('about'); this.route('dashboard', function() { this.route('index', { path: '/dashboard/calendar'}); // ^should direct all dashboard index requests to das

我正在遵循(v2.14.0),我正在尝试设置一个嵌套的子路由,其中索引路由应该重定向到不同的子例程

Router.map(function() {
  this.route('about');
  this.route('dashboard', function() {
    this.route('index', { path: '/dashboard/calendar'});
    // ^should direct all dashboard index requests to dashboard/calendar right?
    // setting path = '/calendar' also doesn't work

    this.route('calendar');
    this.route('daily-journal');
  });
});
但是当我加载
http://localhost:3000/dashboard
,我收到以下错误:


你知道我做错了什么吗?

如果你想重定向到另一条路线/从仪表板-你可以使用从路线重定向:

您只需在仪表板索引路径中添加一些内容

import Ember from 'ember';

export default Ember.Route.extend({
  beforeModel() {
    this.transitionTo('dashboard.calendar');
  }
});

显示
链接到
?我没有使用
链接到
,我直接将
本地主机:3000/仪表板
放在ChromeIt中。这似乎使仪表板索引和所有子路由(对于我来说
仪表板/呼叫
仪表板/日历
)重定向到
仪表板/日历
:(是否有办法限制此操作,以便只有
仪表板
(索引路由)重定向?如果您明确地将其放入dashboard.index的路由文件中-