【问题标题】:Meteor .helpers function parameterMeteor .helpers 函数参数
【发布时间】:2015-06-07 07:27:43
【问题描述】:

是否可以将参数从我的模板传递给 .helpers 函数参数?我正在尝试下面的代码,但我总是收到下面显示的错误。谢谢

Template.documentUpdate.helpers({

    getDocID: function(dCode){      
       return docsIDArray[dCode];
    }
});

在模板中:

<input type="hidden" id="docID" name="docID" value="{{getDocID(1) }}">

错误:

Exception from Tracker recompute function: Error: No such function: getDocID

【问题讨论】:

    标签: meteor meteor-blaze


    【解决方案1】:

    你的语法不正确,试试这个:

    <input type="hidden" id="docID" name="docID" value="{{getDocID 1}}">
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-04-01
      • 1970-01-01
      • 2023-03-11
      • 1970-01-01
      • 2012-10-15
      • 2014-11-19
      • 2017-09-05
      • 2015-03-21
      相关资源
      最近更新 更多