UNPKG

yk-element-components-v2

Version:

126 lines (125 loc) 3.27 kB
function h(t, e, o, a, u, s, l, f) { var n = typeof t == "function" ? t.options : t; e && (n.render = e, n.staticRenderFns = o, n._compiled = !0), a && (n.functional = !0), s && (n._scopeId = "data-v-" + s); var r; if (l ? (r = function(i) { i = i || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !i && typeof __VUE_SSR_CONTEXT__ < "u" && (i = __VUE_SSR_CONTEXT__), u && u.call(this, i), i && i._registeredComponents && i._registeredComponents.add(l); }, n._ssrRegister = r) : u && (r = f ? function() { u.call( this, (n.functional ? this.parent : this).$root.$options.shadowRoot ); } : u), r) if (n.functional) { n._injectStyles = r; var _ = n.render; n.render = function(c, d) { return r.call(d), _(c, d); }; } else { var p = n.beforeCreate; n.beforeCreate = p ? [].concat(p, r) : [r]; } return { exports: t, options: n }; } const m = { name: "yk-pagination", props: { total: { required: !0, type: [Number, String] }, page: { type: [Number, String], default: 1 }, limit: { type: Number, default: 20 }, pageSizes: { type: Array, default() { return [10, 20, 30, 50]; } }, pagerCount: { type: Number, default: document.body.clientWidth < 992 ? 5 : 7 }, layout: { type: String, default: "sizes, prev, pager, next" }, background: { type: Boolean, default: !0 }, autoScroll: { type: Boolean, default: !0 }, hidden: { type: Boolean, default: !1 } }, computed: { currentPage: { get() { return Number(this.page); }, set(t) { this.$emit("update:page", t); } }, pageSize: { get() { return this.limit; }, set(t) { this.$emit("update:limit", t); } } }, methods: { handleSizeChange(t) { this.$emit("pagination", { page: this.currentPage, limit: t }); }, handleCurrentChange(t) { this.$emit("pagination", { page: t, limit: this.pageSize }); } } }; var v = function() { var e = this, o = e._self._c; return o("div", { staticClass: "pagination-container", class: { hidden: e.hidden } }, [o("div", { staticClass: "pagination_left" }, [e._v("\u5171 " + e._s(Number(e.total)) + " \u9879\u6570\u636E")]), o("el-pagination", e._b({ attrs: { background: e.background, "current-page": e.currentPage, "page-size": e.pageSize, layout: e.layout, "page-sizes": e.pageSizes, "pager-count": e.pagerCount, total: Number(e.total) }, on: { "update:currentPage": function(a) { e.currentPage = a; }, "update:current-page": function(a) { e.currentPage = a; }, "update:pageSize": function(a) { e.pageSize = a; }, "update:page-size": function(a) { e.pageSize = a; }, "size-change": e.handleSizeChange, "current-change": e.handleCurrentChange } }, "el-pagination", e.$attrs, !1))], 1); }, C = [], y = /* @__PURE__ */ h( m, v, C, !1, null, null, null, null ); const g = y.exports, z = { install(t) { t.component(g.name, g); } }; export { z as default };