<template>
  <el-pagination
    background
    @current-change="requestData"
    @size-change="requestData"
    :page-size.sync="page.pageSize"
    :current-page.sync="page.pageNum"
    :total="page.total">
  </el-pagination>
</template>

<script>
export default {
  name: 'Pagination',
  props: {
    page: {
      type: Object,
      default: () => {
        return {
          pageNum: 1,
          pageSize: 10,
          total: 0
        }
      }
    }
  },
  methods: {
    requestData() {
      this.$emit('requestData')
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
