'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
var elementPlus = require('element-plus');

"use strict";
const __default__ = vue.defineComponent({
  name: "me-pagination"
});
var script = /* @__PURE__ */ vue.defineComponent({
  ...__default__,
  props: {
    pagination: { type: Object, required: true, default: () => ({
      pageIndex: 1,
      pageSize: 10,
      pageDataTotal: 0
    }) },
    pageSizes: { type: Array, required: false, default: () => [10, 15, 20, 50, 100] }
  },
  emits: ["current-change", "size-change"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const getPagination = vue.computed(() => props.pagination);
    const onCurrentChange = (val) => {
      emit("current-change", val);
    };
    const onSizeChange = (val) => {
      getPagination.value.pageIndex = 1;
      emit("size-change", val);
    };
    return (_ctx, _cache) => {
      return vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElPagination), vue.mergeProps({
        "current-page": getPagination.value.pageIndex,
        "onUpdate:currentPage": _cache[0] || (_cache[0] = ($event) => getPagination.value.pageIndex = $event),
        "page-size": getPagination.value.pageSize,
        "onUpdate:pageSize": _cache[1] || (_cache[1] = ($event) => getPagination.value.pageSize = $event),
        background: "",
        total: getPagination.value.pageDataTotal,
        class: "me-pagination",
        layout: "total, sizes, prev, pager, next, jumper",
        "page-sizes": __props.pageSizes,
        small: "",
        onCurrentChange,
        onSizeChange
      }, _ctx.$attrs), null, 16, ["current-page", "page-size", "total", "page-sizes"]);
    };
  }
});

exports.default = script;
//# sourceMappingURL=pagination.vue2.js.map
