el-table表格序号倒序

 

      <el-table-column fixed label="序号" align="center" width="50">
            <template slot-scope="scope">
              {{ computedIndex( scope.row.index) }}
            </template>
          </el-table-column>

// data
      listQuery: {// 分页
        superQueryJson: '',
        currentPage: 1,
        pageSize: 20,
        sort: 'desc',
        sidx: 'createtime'
      },
      total: 0, // 总数

  computed: {
    computedIndex() {
      return val => {
        return this.total - (val + this.listQuery.pageSize * (this.listQuery.currentPage - 1))
      }
    }
  },