html:
<li v-for="(item,index) in CamerList" :key="index" v-if="index<pagenum && index>=pagenums">
<!--分页-->
<div>
<el-pagination
@current-change="handleCurrentChange"
layout="total,prev, pager, next"
:total=CamerList.length
:page-size = pageSize
class="page"
>
</el-pagination>
</div>
data:
total: '',
// 当前页码
currentPage: 1,
// 每页数量
pageSize: 12,
pagenum: 12,
pagenums: 0,
script:
handleCurrentChange (val) {
// 获取当前页
this.currentPage = val
console.log(this.currentPage)
this.pagenum = this.currentPage * this.pageSize
this.pagenums = (this.currentPage - 1) * this.pageSize
},