<el-pagination
background
layout="prev, pager, next"
@current-change="changePage"
:current-page.sync="currentPage"
:page-size="pageSize"
:total="total"
v-if="total != 0"
>
</el-pagination>
data() {
return {
total: 10,
currentPage: 1,
pageSize: 20,
}
}
methods:{
changePage(str) {
console.log("选择的页数", str);
this.currentPage = str;
this.getData();
},
getData() {
let obj = {
exchange_name: this.exchange_name,
page: this.currentPage,
pageSize: this.pageSize,
};
fetchCodeList(obj)
.then((res) => {
console.log("兑换码管理列表", res);
this.tableData = res.data.data;
this.total = res.data.totalCount;
})
.catch((err) => {
console.log(err);
});
},
}