<template>
<div class="pagination-slot">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="total, prev, pager, next, jumper"
:current-page.sync="currentPage"
:page-size="limit"
:pager-count="7"
:total="total"
:small="small">
</el-pagination>
</div>
</template>
<script>
export default {
name: "pagination",
data() {
return {
current: this.currentPage
}
},
props: {
total: {
type: Number,
default: 0
},
limit: {
type: Number,
default: 10
},
small: {
type: Boolean,
default: false
},
currentPage: {
type: Number,
default: 1
}
},
methods: {
handleCurrentChange(val) {
this.$emit("handleCurrentChange", val);
},
handleSizeChange(val) {
this.currentPage = 1;
this.$emit('handleSizeChange', val);
}
}
}
</script>
<style scoped>
.pagination-slot {
margin: 30px 0;
display: flex;
justify-content: flex-end;
}
</style>