UI:
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="goodsInfo.pagenum"
:page-sizes="[10, 20, 30, 40]" :page-size="goodsInfo.pagesize"
layout="total, sizes, prev, pager, next, jumper" :total="this.total">
</el-pagination>
data:
goodsInfo: {
type: 3,
pagenum: 1,
pagesize: 5
},
total: 0
methods:
handleSizeChange (val) {
// console.log(`每页 ${val} 条`)
this.goodsInfo.pagesize = val
this.getCateList()
},
handleCurrentChange (val) {
// console.log(`当前页: ${val}`)
this.goodsInfo.pagenum = val
this.getCateList()
}
点击每页十条,表格还是渲染出所有数据
排查下接口的问题,看下入参和接口分页返回,可能是接口的问题呢