el-table 序号

  <el-table :data="xpList" border style="width: 100%" height="500" >
    <el-table-column prop="" label="序号" :formatter="nShowIndex" width="80"></el-table-column>
    <el-table-column label="序号1" align="center" width="80">
      <template slot-scope="scope">
        {{scope.$index + 1 + page.pageSize*(page.currentPage-1)}}
      </template>
    </el-table-column>
    <el-table-column prop="name" label="姓名" width="180"></el-table-column>
    <el-table-column prop="age" label="年龄" width="120"></el-table-column>
  </el-table>

方法:

  nShowIndex(row, column, cellValue, index){
      return index + 1;
    }
posted @ 2021-07-01 22:06  寒冷的雨呢  阅读(584)  评论(0编辑  收藏  举报