页面中table后面的代码如下:
<el-pagination :current-page="formData.currentPage" :page-sizes="[5, 10, 15, 20, 50, 100]"
:page-size="formData.pageSize" :total="formData.count" class="manual-table2-pagination"
layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange"
@current-change="handleCurrentChange" />
formData内容如下
formData: {
currentPage: 1,
pageSize: 10,
count: 0,
productIds: []
},
handleSizeChange和handleCurrentChange代码如下
handleSizeChange(pageSize) {
this.formData.pageSize = pageSize
this.getScriptByProductIds()
},
handleCurrentChange(currentPage) {
this.formData.currentPage = currentPage
this.getScriptByProductIds()
},
style中的代码
.manual-table2-pagination {
margin-top: 18px;
text-align: right;
margin-right: 45%;
}