【发布时间】:2019-01-25 20:29:21
【问题描述】:
我使用的是 Ember 3,但在使用带有动态分段的路由器服务时遇到问题。在我的组件中,我使用路由器服务来transitionTo单击子路由,但出现此错误:
错误:传递的上下文对象多于动态对象 路线段:data.images.image
这是在组件js中,我使用transitionTo并为一个动态段传递一个参数:
router: service(),
actions: {
navToSubpage() {
// this.image is a single Ember Data record/object
this.router.transitionTo('data.images.image', this.image)
}
},
这是来自我的路由器,它有一个带有一个动态段的嵌套路由:
Router.map(function() {
this.route('data', function() {
this.route('images', function() {
this.route('image', {path: '/image_id'});
});
});
});
我做错了什么?在这种情况下,这个错误对我来说没有意义。
【问题讨论】:
标签: ember.js ember.js-3