我正在尝试使用iron:router 来实现页面之间的转换。我在 css 中定义了动画,现在我需要的就是用iron:router 调用它们。由于某种原因,以下代码:
animateContentOut = function() {
$('#content').removeClass("animated fadeIn");
return $('footer').addClass("hide");
}
fadeContentIn = function() {
$('#content').addClass("animated fadeIn");
return $('footer').removeClass("hide");
}
Router.onBeforeAction(animateContentOut);
Router.onAfterAction(fadeContentIn);
返回异常:
Route dispatch never rendered. Did you forget to call this.next() in an onBeforeAction?
最佳答案
根据 Iron-Router 文档中的规定,现在 onBeforeAction
和 onAfterAction
回调都需要 this.next()
。 https://github.com/iron-meteor/iron-router
因此,只需将该行添加到 fadeContentIn
和 animateContentOut
代码的末尾即可。
关于javascript - meteor 铁:router transitions,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34643947/