使用场景
饿了么的table表格的序号我本来使用的是
<el-table-column label="序号" type="index" width="50"></el-table-column>
如果表格每页显示10条数据,这样表格的每一页的序号都是1到10。
现在有个需求是第一页显示1-10,第二页显示11-20,。因此需要改一下。
解决方法
<el-table-column label="序号" width="50">
<template slot-scope="scope">
{{searchData.pageSize * (searchData.pageNo - 1) + (scope.$index + 1)}}
</template>
</el-table-column>