表格的序号倒序显示

公式:

page.total - (循环变量 + page.limit * (当前页数 - 1))

样式:

思路:

 <el-table-column label="序号" width="100">
          <template slot-scope="scopeIndex">
            <span>{{computedIndex(scopeIndex.$index)}}</span>
          </template>
        </el-table-column>

  

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

猜你喜欢

转载自www.cnblogs.com/zmdblog/p/12746170.html