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: 每頁數

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