<template>
  <el-pagination
    class="th-pagination"
    :current-page="page"
    :page-size="pageSize"
    :total="total"
    :layout="layout"
    :pager-count="pagerCount"
    :page-sizes="pageSizes"
    :hide-on-single-page="hideOnSinglePage"
    :popper-class="popperClass"
    :disabled="disabled"
    v-bind="$props"
    v-on="$listeners"
  >
    <div class="th-pagination--slot">
      <slot />
    </div>
  </el-pagination>
</template>
<script>
export default {
  name: 'ThPagination',
  props: {
    // 当前页
    page: {
      type: Number,
      default: 1
    },
    // 每页多少条
    pageSize: {
      type: Number,
      default: 20
    },
    // 总数
    total: {
      type: Number,
      default: 0
    },
    // 布局slot
    layout: {
      type: String,
      default: 'slot, ->, total, sizes, prev, pager, next, jumper'
    },
    // 最多页数点击
    pagerCount: {
      type: Number,
      default: 5
    },
    // 每页条数选择
    pageSizes: {
      type: Array,
      default: () => [10, 20, 30, 40, 50, 100]
    },
    // 是否单页时隐藏
    hideOnSinglePage: {
      type: Boolean,
      default: false
    },
    // 下拉样式
    popperClass: {
      type: String,
      default: 'th-pagination__popper'
    },
    // 是否禁用
    disabled: {
      type: Boolean,
      default: false
    }
  }
}
</script>
