Метеор Курурин Пагинация не работает

1

Я использую Kurourin пакет PAGINATION в рамках meteorJS и он не работает. Он возвращает ошибку только в моем файле blaze html. Он также отображает загрузку только в моем html файле. Я только новичок в пакете, поэтому, пожалуйста, поймите.

Код ниже в соответствии с документацией в атмосфере

//Error 
Error: No such template: defaultBootstrapPaginator
at blaze.js:3212
at Blaze.View.<anonymous> (spacebars.js:68)
at blaze.js:1934
at Function.Template._withTemplateInstanceFunc (blaze.js:3744)
at blaze.js:1932
at Object.Blaze._withCurrentView (blaze.js:2271)
at viewAutorun (blaze.js:1931)
at Tracker.Computation._compute (tracker.js:339)
at new Tracker.Computation (tracker.js:229)
at Object.Tracker.autorun (tracker.js:613)

//blaze html file 
<div class="row">
{{#if isReady}}
        <ul class="list-group">
          {{#each platforms}}
              <li class="list-group-item">{{platform}}</li>
          {{/each}}
        </ul>
        {{> defaultBootstrapPaginator pagination=templatePagination limit=10 containerClass="text-center" onClick=clickEvent}}
{{/if}}
</div>


//create_hardwarepl.js file
Template.create_hardwarepl.onCreated(function () {
this.pagination = new Meteor.Pagination(Platforms, {
    sort: {
        _id: -1
    }
});
});

Template.create_hardwarepl.helpers({
 platforms: function()
 {
   return Platforms.find({},{sort: {createdAt: -1}});
 },
 isReady: function () 
 {
   return Template.instance().pagination.ready();
 },
 templatePagination: function () 
 {
    return Template.instance().pagination;
 },
 documents: function () 
 {
    return Template.instance().pagination.getPage();
 },
 // optional helper used to return a callback that should be executed before 
    changing the page
 clickEvent: function() 
 {
   return function(e, templateInstance, clickedPage) 
   {
      e.preventDefault();
      console.log('Changing page from ', 
      templateInstance.data.pagination.currentPage(), ' to ', clickedPage);
   };
 }
 });

//server/publications.js file

import { publishPagination } from 'meteor/kurounin:pagination';

publishPagination(Platforms);

Изображение 174551

Изображение 174551

Теги:
pagination
meteor
nosql
meteor-blaze

2 ответа

3

У меня была та же проблема, с которой вы столкнулись, и затем я проверил репозитории kurourin GitHub, и есть еще одна подписка на основе pagination.click this link

Выше ссылка поможет вам

0

Добавить метеорный пакет kurounin: pagination-blaze: meteor add kurounin:pagination-blaze

См. Https://atmospherejs.com/i/installing

Ещё вопросы

Сообщество Overcoder
Наверх
Меню