【问题标题】:chunk results of meteor Easy Search流星轻松搜索的块结果
【发布时间】:2016-05-12 17:47:22
【问题描述】:

您好,我在 Meteor 上使用 matteodem:easy-search 包。现在我正在将我的结果分组为size

Template.UserList.helpers({
  users: function () {
    all = Meteor.users.find().fetch();
    chunks = [];
    size = 3;
    while (all.length > size) {
      chunks.push({ row: all.slice(0, size)});
      all = all.slice(size);
    }
    chunks.push({row: all});
    return chunks;
  }
});

它就像一个魅力,但现在我想知道如何使用

{{#EasySearch.Each index=playersIndex }}

因为您不能拆分索引。任何人都知道让 EasySearch.Each 与 Bootstrap 行一起工作吗?

谢谢。

【问题讨论】:

  • 你不能用你的EasySearch.Index 来代替 find 调用吗?

标签: meteor meteor-easy-search


【解决方案1】:

看看EasySearch.Each 做了什么(https://github.com/matteodem/meteor-easy-search/blob/master/packages/easysearch:components/lib/each/each.js),看来你可以直接使用

index.getComponentMethods().getCursor()

一旦您创建了索引,即只需将您的 find 调用替换为上述内容,它可能会起作用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-11-19
    • 2012-06-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-22
    相关资源
    最近更新 更多