Vue分页控件报错 “pagerCount“
Vue分页控件报错 “pagerCount“
·
报错信息:[Vue warn]: Invalid prop: custom validator check failed for prop “pagerCount”.
<template>
<div class="pagination">
<el-pagination
small
background
:layout="layout"
:total="total"
:current-page="query.pageNum"
:page-size="query.pageCount"
:pager-count="pagerCount"
:page-sizes="pageSizes"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
>
</el-pagination>
</div>
</template>
<script>
export default {
name: 'pagination',
data () {
return {
query: {
pageNum: 1,
pageCount: 10,
},
layout: "total, sizes, prev, pager, next, jumper",
total: 0,
pageSizes: [8, 24, 40],
pagerCount: 5,
}
},
methods: {
handleCurrentChange(val) {this.query.pageNum = val},
handleSizeChange(val) {this.query.pageCount = val},
}
}
</script>
解决:pager-count只能设置5-21的奇数。
更多推荐
已为社区贡献4条内容
所有评论(0)