jQuery tmpl index

时间:2022-09-27 04:10:03
  <!-- 校验失败后显示 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;
});