表格的序号倒序显示

公式:

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))
      };
    },
}

 

posted @ 2020-04-21 17:34  墨染清浅  阅读(1163)  评论(0)    收藏  举报