有没有人在流星中使用过 aldeed:tabular 包?

Var*_*dan 1 tabular mongodb meteor

我正在从这里尝试流星中的 aldeed:tabular 包。这是我的代码

客户端:

TabularTables = {};
Books= new Mongo.Collection('books');

Meteor.isClient && Template.registerHelper('TabularTables', TabularTables);

TabularTables.Books = new Tabular.Table({
  name: "BookList",
  collection: Books,
  columns: [
    {data: "title", title: "Title"},
    {data: "author", title: "Author"},
    {data: "copies", title: "Copies Available"},


  ]
});
Run Code Online (Sandbox Code Playgroud)

在 html 文件中:

{{> tabular table=TabularTables.Books class="table table-striped table-bordered table-condensed"}}
Run Code Online (Sandbox Code Playgroud)

我可以看到表格已形成,但在表格中显示数据时遇到问题。我在做什么错?

小智 5

也许您只在客户端定义了 TabularTables?将其定义为共享资源(例如,在客户端文件夹之外)应该可以解决您的问题。