有没有人在流星中使用 aldeed:表格包



我正在从这里尝试 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"},

  ]
});

在 html 文件中:

{{> tabular table=TabularTables.Books class="table table-striped table-bordered table-condensed"}}

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

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

最新更新