vue-element-admin 实现table序号递减和递增

element ui 实现table序号递减和递增

递减demo
<el-table-column align="center" :label="'序号'" width="65">
        <template slot-scope="scope">
          //<span>{{ list.length-scope.$index - (listQuery.page-1)*listQuery.limit  }}</span>   
          // 用total
          <span>{{ total-scope.$index - (listQuery.page-1)*listQuery.limit  }}</span>
        </template>
  </el-table-column>
递增demo
<span>{{(listQuery.page - 1) * listQuery.limit + scope.$index + 1}}</span>

total:总条数
listQuery.page;当前页
listQuery.limit: 每页数

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章