<script setup>
const props = defineProps({
  page_no: {
    type: Number,
    default: 1,
  },
  pageSize: {
    type: Number,
    default: 10,
  },
  total: {
    type: Number,
    default: 0,
  },
  pagercount: {
    type: Number,
    default: 7,
  },
});

const emit = defineEmits(["handleCurrentChange", "handleSizeChange"]);

/* 页码改变 */
const handleCurrentChange = (page) => {
  emit("handleCurrentChange", page);
};
/* 每页条数改变 */
const handleSizeChange = (size) => {
  emit("handleSizeChange", page);
};
</script>

<template>
  <el-pagination
    layout="total,prev,pager,next,jumper"
    background
    :current-page="props.page_no"
    @current-change="handleCurrentChange"
    :page-size="props.pageSize"
    @size-change="handleSizeChange"
    :total="props.total"
    :pager-count="props.pagercount"
    style="float: right"
  >
  </el-pagination>
</template>
