【发布时间】:2014-11-07 06:21:28
【问题描述】:
在每个循环中数据未显示。value="{{param_type}}" 未显示。请帮助我。
{{ #each api_method_param_data }}
<select id="param_type">
{{#each dropdown}}
{{#if isSelected this param_type}}
<option value="{{param_type}}" selected="selected"> {{this}} </option>
{{else}}
<option value="{{param_type}}" > {{this}} </option>
{{/if}}
{{/each}}
</select>
{{/each}}
这是辅助函数
Template.apimethodchange.isSelected = function(fooToCheck, recordFoo)
{
var checkrec = "";
for(var i=0;i<recordFoo.length;i++)
{
checkrec = checkrec + recordFoo[i];
}
console.log(checkrec + fooToCheck);
return (fooToCheck == checkrec);
};
Template.apimethodchange.dropdown = ["string","array","int","boolean","double","struct"];
【问题讨论】:
-
你能告诉我们数据上下文或辅助函数是什么样的吗?
-
我添加了辅助功能请检查一次。@richsilv
标签: meteor