1
我有一些路由器代码:Meteor Iron Router挂钩的执行顺序是什么?
Router.route('/box', {
name: 'box',
action: function(){
this.layout('appWrapperLoggedInTpl');
this.render('boxCanvasTpl');
},
onAfterAction: function(){
console.log("onAfterAction executed!");
renderBoxPage();
}
});
和onRendered功能: “onAfterAction执行”
Template.boxCanvasTpl.onRendered(function() {
console.log('onRendered executed!');
});
当我运行这一点,出现在“onRendered执行!”之前信息。我会认为路由器代码的this.render('boxCanvasTpl');
部分会事先执行,这是不是预期的?