<template>

  <el-pagination
    class="pagination-div"
    style="text-align: left;"
    @size-change="handleSizeChange"
    @current-change="currentChange"
    :current-page="currentPage"
    :page-sizes="[10, 15,20,50,100,200,500, 1000]"
    :page-size="pageSize"
    layout="total, sizes, prev, pager, next"
    background
    :total="total"
  ></el-pagination>

</template>
<script>
export default {
  name: 'index',
  components: {},
  props: {
    total: {
      type: Number,
      default: null
    },
    pageSize: {
      type: Number,
      default: null
    },
    currentPage: {
      type: Number,
      default: 1
    },
  },
  data () {
    return {}
  },
  created () { },
  mounted () { },
  methods: {
    handleSizeChange (val) {
      // console.log(`每页 ${val} 条`);
      this.$emit('changePageSize', val)
    },
    currentChange (val) {
      // console.log(`当前页: ${val}`);
      this.$emit('changePage', val)
    },
    prevClick (val) {
      this.$emit('changePage', val)
    },
    nextClick (val) {
      this.$emit('changePage', val)
    },
  }
}
</script>
<style lang="less" scoped>
  .pagination-div  .el-pagination {
    text-align: left;
  }
  .pagination-div  .number:hover, .pagination-div  .more:hover {
    color: #4bd198!important;
  }
  .pagination-div  .active{
    background-color: #4bd198!important;
  }
  .pagination-div  .active:hover{
    color: #fff!important;
  }
</style>
