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数据中的变量名⼀致,不然会报错
最终效果
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论