我正在尝试将多个 .hbs 片段呈现到它们各自的插座中。但是,以下 renderTemplate 不起作用:
renderTemplate: function() {
// default behavior, renders the home template
this.render();
this.render('hero', { // render the `hero` template
outlet: 'hero' // using the outlet named `hero`
});
},
有问题的模板文件如下所示:
{{outlet 'hero'}}
{{outlet}}
这实际上会渲染默认模板(这是索引路由)两次:一次在 hero 出口中,一次在常规出口中。
这似乎在 ember1.7 中有效,即使 hero 出口包含在 application.hbs 模板中。ember2.3 并非如此。
我将如何进行这项工作?