import { reactive as l, h as r, nextTick as i, render as s, toRefs as c } from "vue";
import { ElConfigProvider as g, ElPagination as d } from "element-plus";
import { ae as p } from "./main-DXvReGBc.js";
function x(n) {
  const e = Object.assign({
    el: "",
    extMethod: () => {
    },
    currentPage: 1,
    pageSize: 20,
    total: 0,
    background: !1,
    pageSizes: [20, 50, 100],
    layout: "total, sizes, prev, pager, next, jumper",
    locale: p
  }, n), t = l(Object.assign({}, e));
  delete t.el, delete t.extMethod, delete t.locale;
  const a = r(
    g,
    { locale: e.locale },
    () => r(
      d,
      Object.assign({
        onCurrentChange: (o) => {
          t.currentPage = o, e.extMethod && e.extMethod();
        },
        onSizeChange: (o) => {
          t.pageSize = o, e.extMethod && e.extMethod();
        }
      }, t)
    )
  );
  return i(() => {
    if (!e.el)
      throw new Error("缺少渲染分页器的 'DOM' 节点，属性 'el' 不能为空，请传入一个 'DOM' 对象或字符串类名");
    const o = typeof e.el == "string" ? document.querySelector(e.el) : e.el;
    o && s(a, o);
  }), {
    ...c(t)
  };
}
export {
  x as u
};
