<template>
  <div id="agination">
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="currentPage"
      :page-sizes="pageSizes"
      :page-size="pageSize"
      layout="total, sizes, prev, pager, next, jumper"
      :total="total"
    >
    </el-pagination>
  </div>
</template>

<script>
export default {
  props: ["total", "pageSize", "currentPage"],
  data() {
    return {
      //   currentPage: 1, //当前位于页
      pageSizes: [10, 20, 50, 100, 200, 500], //每页多少条分组
    };
  },
  methods: {
    //切换X条/页触发
    handleSizeChange(val) {
      this.$emit("handleSizeChange", val);
    },
    //跳转页触发
    handleCurrentChange(val) {
      this.$emit("handleCurrentChange", val);
    },
  },
};
</script>

<style lang="less" scoped>
#agination {
  margin-left: 26px;
  margin-top: 16px;
}
</style>
