FooterPagination.vue
828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<template>
<div class="wrapper">
<el-pagination
background
layout="total, prev, pager, next, sizes, jumper"
:total="pagination.total"
:current-page.sync="pagination.page"
:page-size.sync="pagination.size"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
></el-pagination>
</div>
</template>
<script>
export default {
props: {
pagination: {
type: Object,
default: () => ({ size: 10, total: 0, page: 1 })
}
},
methods: {
handleCurrentChange(page) {
this.$emit('pagination', { ...this.pagination, page })
},
handleSizeChange(size) {
this.$emit('pagination', { ...this.pagination, size })
}
}
}
</script>
<style lang="scss" scoped>
.wrapper {
display: flex;
justify-content: flex-end;
}
</style>