分页组件
<el-pagination
@size-change="handleSizeChange"
:prev-text="$t('pages.previousPage')"
:next-text="$t('pages.nextPage')"
@current-change="handleCurrentChange"
:current-page="queryPageParams.pageNum"
:page-sizes="queryPageSizes"
:page-size="queryPageParams.pageSize"
:layout="layout"
:total="queryPageParams.total"
background
>
<button
type="button"
@click="handleCurrentChange(1)"
class="btn-prev el_pagination_firstPage"
>
{{ $t("pages.firstPage") }}
</button>
<button
type="button"
@click="handleCurrentChange(Math.ceil(queryPageParams.total / queryPageParams.pageSize))"
class="btn-prev el_pagination_lastPage"
>
{{ $t("pages.lastPage") }}
</button>
</el-pagination>
分页方法
handleSizeChange(val) {
this.queryPageParams.pageSize = val;
this.queryReceiptInfo();
},
handleCurrentChange(val) {
this.queryPageParams.pageNum = val;
this.queryReceiptInfo();
},
分页参数
queryPageParams: {
pageNum: 1,
pageSize: 5,
total: 0,
},
queryPageSizes:[5, 10, 20, 50],