el-table前面加序號


 

https://i.cnblogs.com/posts?cateId=1048797

<template>
  <el-table
    :data="list"
    class="bg-fff"
    :row-class-name="rowIndex"
    >
    <el-table-column
      :formatter="order"
      label="序號"
      width="100">
    </el-table-column>
  </el-table>
</template>
methods: {
    rowIndex({row, rowIndex}) {
      row.rowIndex = rowIndex;
    },
    order(row) {
      return this.pageBeanInter.pageSize * (this.pageBeanInter.pageNum - 1) + row.rowIndex + 1;
    }
  }

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM