<template>
  <div class="bg-pagination">
    <el-pagination
      :small="small"
      :currentPage="page"
      :page-size="size"
      :page-sizes="pageSizes"
      :layout="layout"
      :total="total"
      @size-change="changeSize"
      @current-change="changePage"
      :background="background"
      :disabled="disabled" />
  </div>
</template>

<script setup>
const props = defineProps({
  small: {
    type: Boolean,
    default: () => false,
  },
  page: {
    type: Number,
    default: 1,
  },
  size: {
    type: Number,
    default: 10,
  },
  pageSizes: {
    type: Array,
    default: [10, 50, 100],
  },
  total: {
    type: Number,
    default: 0,
  },
  layout: {
    type: String,
    default: "total, sizes, prev, pager, next, jumper",
  },
  background: {
    type: Boolean,
    default: false,
  },
  disabled: {
    type: Boolean,
    default: false,
  },
});
const emit = defineEmits(["change-page", "change-size"]);

const changePage = (val) => {
  emit("change-page", val);
};

const changeSize = (val) => {
  emit("change-size", val);
};
</script>
