indexMethods(index) {
    // currentpage当前页码,this.tableData.length总条数,index索引值
    if (this.tableData.length < 10) {
        return (this.tableData.length - index)
    } else {
        return (this.tableData.length - ((this.currentpage - 1) * 10) - index)
    }
}
<el-table ref="table" :data="tableData" style="width: 100%;height: 100%;" max-height="100%" height="100%"
  :header-cell-style="headerCellStyle" :row-class-name="headerRowClassName" border>
  <el-table-column label="No." width="70" type="index">
    <template #header="">No.</template>
    <template #default="{ row, $index }">
      <div class="no-area">
        <span>{{ indexMethods($index) }}</span>
      </div>
    </template>
  </el-table-column>
</el-table>
最后修改:2023 年 05 月 08 日
如果觉得我的文章对你有用,请随意赞赏