jQuery tmpl index

  <!-- 校验失败后显示 TODO-->
<script id="checkError_table_tmpl" type="text/x-handlebars-template">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>序号</th>
<th>校验结果</th>
<th>任务单号</th>
</tr>
</thead>
<tbody>
{{#each checkErrorList}}
<tr>
<td>{{addOne @index}}</td>
<td>{{verifyResult}}</td>
<td>{{taskbillNo}}</td>
</tr>
{{/each}}
</tbody>
</table>
</script>

<script>
var handleHelper = Handlebars.registerHelper("addOne", function (index) {
//返回+1之后的结果
return index + 1;
});
posted @ 2016-07-13 12:22  雄狮_杜  阅读(482)  评论(0编辑  收藏  举报