我最近在我的项目中添加了lepozepo:publish-with-relations包,我正在尝试发布购物车
Meteor.publish "cart", (ops={}) ->
if ops.cotizacion and not _.isEmpty ops.cotizacion
@relations
collection:Cotizaciones
filter:
_id:ops.cotizacion
status:"new"
mappings:[
{
key:"cotizacion"
collection:CotDetails
options:
limit:25
mappings:[
{
foreign_key:"codigo"
collection:Productos
}
]
}
]
@ready()
我的订阅是以下
Template.CotIzq.onCreated ->
self = this
self.autorun ->
self.subscribe 'cart'
如果我添加autopublish包,我可以看到该出版物。所以我知道问题在这里
答案 0 :(得分:0)
看起来你没有为你的出版物的function honor()
{
document.getElementById("honor_mul").style.display="block";
var container = document.getElementById("honor_mul");
var table = document.createElement('table');
table.setAttribute("class","test");
table.setAttribute("id","table_rank");
var tableRow = table.insertRow(0);
var tableCell = tableRow.insertCell(0);
tableCell.appendChild(document.createTextNode("Rank"));
container.appendChild(table);
tableCell = tableRow.insertCell(1);
tableCell.appendChild(document.createTextNode("Nome"));
container.appendChild(table);
tableCell = tableRow.insertCell(2);
tableCell.appendChild(document.createTextNode("Score"));
container.appendChild(table);
for( var i=1; i<=10; i++){
{
if(i<=localStorage.length)
{
var tableRow = table.insertRow(i);
var tableCell = tableRow.insertCell(0);
tableCell.appendChild(document.createTextNode(i));
container.appendChild(table);
var tableCell = tableRow.insertCell(1);
tableCell.appendChild(document.createTextNode(localStorage.getItem(localStorage.key(i-1))));
container.appendChild(table);
var tableCell = tableRow.insertCell(2);
tableCell.appendChild(document.createTextNode(localStorage.key(i-1)));
var tableCell = tableRow.insertCell(3);
tableCell.appendChild(document.createTextNode(localStorage.getItem()));
}
}
}
}
参数传递任何选项,然后在继续之前检查ops
参数是否为空,尝试要么传递正确的选项,要么取消支票。