angularjs的ng-repeat循环列表中序号怎么写
展开全部
直接上代码,一看就懂了: <table class="table table-bordered mt20 table-td-center"> <thead> <tr> <th>序号</th> <th>昵称</th> <th>性别</th> <th>年龄</th> <th>星座</th> <th>关注时间</th> </tr> </thead> <tbody> <tr ng-repeat="fans in vm.data.users"> <td ng-bind="$index+1">1</td> <td ng-bind="fans.nickname">郑州网建</td> <td ng-bind="fans.gender=='m'?'男':'女'">男</td> <td ng-bind="vm.getDate(fans.birthday)">32</td> <td>白羊座</td> <td>2014-09-02 00:00 </td> </tr> </tbody> </table> $index是从0开始计数的,所以,这里,我们+1
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询