更新
This commit is contained in:
46
src/components/pagination/index.vue
Normal file
46
src/components/pagination/index.vue
Normal file
@@ -0,0 +1,46 @@
|
||||
<template>
|
||||
<div class="pagination">
|
||||
<el-pagination
|
||||
background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="parameter.currentPage"
|
||||
:page-size="parameter.pageSize"
|
||||
:popper-append-to-body="false"
|
||||
:page-sizes="[10, 20, 30, 50]"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="parameter.total"
|
||||
>
|
||||
</el-pagination>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
parameter: Object,
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {
|
||||
// currentPage change
|
||||
handleCurrentChange(page) {
|
||||
this.parameter.currentPage = page;
|
||||
this.$emit("searchAgain");
|
||||
},
|
||||
// pageSize change
|
||||
handleSizeChange(size) {
|
||||
this.parameter.currentPage = 1;
|
||||
this.parameter.pageSize = size;
|
||||
this.$emit("searchAgain");
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.pagination {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user