element ui table 序号显示优化
elementui 提供的 table 组件中,若设置 el-table-column 的属性 type=“index” ,那么对应的列就是序号列。
但是,经过观察这里的需要显示的当前页数据排序后的序号。当我们想要实现全量数据排序序号时,可以参考一下代码实现。
<el-table-column type="index" label="序号" width="70px">
<template slot-scope="scope">
<span>{{(currentPage - 1) * pageSize + scope.$index + 1 }}</span>
</template >
</el-table-column>