私は私のフォーラムにページを追加するのに苦労しています。私を助けてくれますか?基本的には、私はフォーラムのページに10の投稿しか見ないことを期待していました。しかし、それはすべてを返す。 「もっと読み込む」ボタンも何もしません(それは同じようです)。流星ページ区切り
私は、このパッケージを使用しています:
if (Meteor.isClient) {
Deps.autorun(function() {
var handle = Meteor.subscribeWithPagination('posts',10);
});
Template.postsList.helpers({
'posts': function(){
return Posts.find({});
}
});
Template.postsList.events({
'click .btn': function(){
handle.loadNextPage();
}
})
}
if (Meteor.isServer) {
Meteor.startup(function() {
Meteor.publish("posts", function(limit){
return Posts.find({}, {limit: limit});
});
});
}