无论如何要等待模板被渲染然后执行某些功能?
我试过之后,它不起作用。
Router.map(function () {
this.route('post', {
path: '/posts/:ll',
action: function () {
this.render('home');
},
after: function () {
var n = this.params.ll
UI.insert(UI.render(Template[n]), document.getElementById("child"))
}
});
});
原来子元素还不存在,因为在触发 after 函数时还没有渲染“home”模板。
非常感谢任何建议或解决方法。