【发布时间】:2017-12-28 22:35:14
【问题描述】:
使用 Ember 2.17.0,我似乎无法让嵌套在其他动态路由下的路由正确加载。
使用以下文件结构,我希望 stacks 路由加载新页面。
features/instances/
├── edit
│ ├── route.js
│ └── template.hbs
├── index
│ ├── route.js
│ └── template.hbs
├── new
│ ├── route.js
│ └── template.hbs
└── view
├── route.js
├── stacks
│ ├── route.js
│ └── template.hbs
└── template.hbs
stacks 端点的 URL 类似于 /instances/view/91467053-ba03-33b9-8950-83f0e64b4688/stacks/123456
其中123456 是堆栈模型的ID。但是,当我触发页面上方的链接时,不会重新加载,我仍在view 路线上。如果我将{{outlet}} 标记放入view 模板,stacks 的内容就会在那里呈现。但我希望它在它自己的页面上......
我的路由器.js
Router.map(function () {
this.route('instances', function () {
this.route('view', {path: '/view/:instance_id'}, function () {
this.route('stacks', {path: '/stacks/:stack_id'});
});
this.route('edit');
this.route('new');
this.route('all');
});
this.route('error');
});
我在这里做错了什么?我找不到太多关于 ember 2.0+ 的嵌套动态路由
【问题讨论】:
标签: javascript ember.js