【发布时间】:2017-05-12 15:24:37
【问题描述】:
以前,我的路线是定义好的:
this.route('username', {
path: '/:username'
}, function() {
this.route("room", {
path: "/:room",
});
我改成:
this.route('username', {
path: '/:username'
}, function() {
this.route('index')
});
this.route("room", {
path: "/:room"
});
这很好用。但是除非我在router.js 中明确定义索引,否则我的username/index 路由将不会加载。
以下将不起作用:
this.route('username', {
path: '/:username'
});
this.route("room", {
path: "/:room",
});
这是正常行为吗?
【问题讨论】:
-
也许你可以举一个这样的例子:ember-twiddle.com/… 我通常不使用索引路由,而是更具体地命名它们。
标签: javascript ember.js routes