FooterPagination.vue 828 Bytes
<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>