Element-ui+vue表格分页序号问题需要达成的效果:每页10条,序号:1-10,11-20,21-30。。。
<el-table-column label="序号"width="55"align="center">
<template slot-scope="scope">
<div>{{(currentPage - 1) * pagesize + scope.$index + 1}}</div>
</template>
</el-table-column>
data数据
vue element admindata(){
return{
total:1000,//默认数据总数
pagesize:10,//每页的数据条数
currentPage:1,//默认开始页⾯
};
},
html中使⽤的变量名,⼀定要和data数据中的变量名⼀致,不然会报错
最终效果