<template>
  <div class="card_input">
    <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
      :page-sizes="pageSizes" :pager-count="pagerCountnum" :layout="layout" :total="total">
    </el-pagination>
  </div>
</template>

<script>
  export default {
    name: "pagination",
    props: {
      currentPage: {
        type: Number,
        default: 1,
      },
      total: {
        type: Number,
        default: 0,
      },
      pagerCountnum: {
        type: Number,
        default: 7,
      },
      layout: {
        type: String,
        default: 'total, sizes, prev, pager, next,jumper',
      },
      pageSizes: {
        type: Array,
        default: () => {
          return [10, 20, 30, 40]
        },
      },
    },
    data() {
      return {

      }
    },
    methods: {
      handleSizeChange(val) {
        // console.log(`每页 ${val} 条`);
        this.$emit('changeSize', val)
      },
      handleCurrentChange(val) {
        // console.log(`当前页: ${val}`);
        this.$emit('changeCurrent', val)
      }
    }
  }
</script>

<style scoped lang="scss">
  .card_input {
    display: flex;
    justify-content: flex-end;
    padding: 10px;
  }
</style>
