<template>
  <div class="card_input">
    <el-pagination @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">
  ::v-deep .el-pagination .el-select .el-input .el-input__inner {
    background-color: rgba(2, 59, 115, .8);
  }

  ::v-deep .el-pagination__jump .el-input__inner {
    border: 1px solid rgba(139, 191, 216, .5) !important;
  }

  .el-pagination {
    background-color: rgba(2, 59, 115, .5);
    margin-top: 10px;
    color: #fff;
    border: 1px solid rgba(2, 59, 115, .8);
    padding: 5px 10px;
    border-radius: 3px;
  }

  ::v-deep .el-pagination__editor.el-input .el-input__inner {
    border: 1px solid rgba(139, 191, 216, .5) !important;
    background-color: unset;
    color: #fff;
  }

  ::v-deep .el-pagination .el-select .el-input .el-input__inner {
    border: 1px solid rgba(139, 191, 216, .5) !important;
    background-color: unset;
    color: #fff;
  }

  ::v-deep .el-pagination button {
    color: #fff !important;
    background-color: unset;
  }

  ::v-deep .el-pager li.btn-quicknext {
    color: #fff !important;
  }

  ::v-deep .el-pager li.btn-quickprev {
    color: #fff !important;
  }

  ::v-deep .el-pager li:hover {
    color: #409EFF !important;
  }
</style>
