我似乎不能让无限滚动从提交12-5开始工作。它只告诉mrt add iron-router-progress,一切都应该正常工作,但我的页面一直在刷新。以下是我正在使用的内容:
PostsListController = RouteController.extend({
template: 'blog',
increment: 20,
limit: function() {
return parseInt(this.params.postsLimit) || this.increment;
},
waitOn: function() {
return Meteor.subscribe('posts', this.limit());
},
posts: function() {
return Posts.find({}, {
limit: this.limit()
});
},
data: function() {
var hasMore = this.posts().count() === this.limit();
var nextPath = this.route.path({
postsLimit: this.limit() + this.increment
});
return {
posts: this.posts(),
nextPath: hasMore ? nextPath : null
};
}
});
Router.map(function() {
this.route('blog', {
path: '/:postsLimit?',
controller: PostsListController
})
})
Router.configure({
layoutTemplate: 'layout',
notFoundTemplate: 'notFound',
});一切似乎都正常,除了当我点击加载更多,页面闪烁,并跳回到顶部!
发布于 2014-05-29 05:32:02
正如您可以在与提交相关的GitHub问题中看到的那样,它实际上是0.7.1版本的iron-router中的一个错误。使用他们使用的版本(查找smart.lock文件),它不会刷新并转到顶部。
https://stackoverflow.com/questions/23902891
复制相似问题