various-ui
Version:
This is a test version of the Vue 3 component library
129 lines (124 loc) • 4.9 kB
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
var index$1 = require('../../icon/index.js');
var index = require('./index.js');
var composable = require('./src/composable.js');
const _hoisted_1 = {
key: 0,
class: "ui-pagination"
};
const _hoisted_2 = {
key: 0,
class: "ui-pagination-items"
};
const _hoisted_3 = { class: "ui-pagination-controls" };
const _hoisted_4 = ["onClick"];
const _hoisted_5 = ["onClick"];
const __default__ = vue.defineComponent({ name: "UiPagination" });
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
...__default__,
props: index.UiPaginationPropsOption,
emits: index.UiPaginationEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const define = __props;
const emits = __emit;
const { computeds, methods } = composable.useComposable(define, emits);
const { controls, total, info } = computeds;
const { switchNumber, next, back } = methods;
__expose({ switchNumber, next, back });
;
return (_ctx, _cache) => {
return vue.unref(total) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
vue.createCommentVNode(" * \u5206\u9875\u4FE1\u606F "),
_ctx.items ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
vue.renderSlot(_ctx.$slots, "items", {
page: _ctx.modelValue,
limit: _ctx.limit,
total: vue.unref(total),
count: _ctx.count
}, () => [
vue.createTextVNode(
vue.toDisplayString(vue.unref(info)),
1
/* TEXT */
)
])
])) : vue.createCommentVNode("v-if", true),
vue.createCommentVNode(" * \u5206\u9875\u63A7\u5236\u5668 "),
vue.createElementVNode("div", _hoisted_3, [
vue.createCommentVNode(" * \u540E\u9000\u63A7\u5236\u5668 "),
vue.createElementVNode(
"div",
{
class: vue.normalizeClass(["ui-pagination-control ui-next", { "ui-disabled-status": _ctx.modelValue <= 1 }]),
onClick: _cache[0] || (_cache[0] = //@ts-ignore
(...args) => vue.unref(back) && vue.unref(back)(...args))
},
[
vue.renderSlot(_ctx.$slots, "arrow", {}, () => [
vue.createVNode(vue.unref(index$1.UiIcon), { name: "arrow" })
])
],
2
/* CLASS */
),
(vue.openBlock(true), vue.createElementBlock(
vue.Fragment,
null,
vue.renderList(vue.unref(controls), (control) => {
return vue.openBlock(), vue.createElementBlock(
vue.Fragment,
{
key: control.type + control.value
},
[
vue.createCommentVNode(" * \u8DF3\u8DC3\u63A7\u5236\u5668 "),
control.type == "skip" ? (vue.openBlock(), vue.createElementBlock("div", {
key: 0,
class: "ui-pagination-control",
onClick: ($event) => vue.unref(switchNumber)(_ctx.modelValue + _ctx.skip * control.value)
}, "...", 8, _hoisted_4)) : (vue.openBlock(), vue.createElementBlock(
vue.Fragment,
{ key: 1 },
[
vue.createCommentVNode(" * \u9009\u62E9\u63A7\u5236\u5668 "),
vue.createElementVNode("div", {
class: vue.normalizeClass(["ui-pagination-control", { "ui-active": control.active }]),
onClick: ($event) => vue.unref(switchNumber)(control.value)
}, vue.toDisplayString(control.value), 11, _hoisted_5)
],
2112
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
))
],
64
/* STABLE_FRAGMENT */
);
}),
128
/* KEYED_FRAGMENT */
)),
vue.createCommentVNode(" * \u524D\u8FDB\u63A7\u5236\u5668 "),
vue.createElementVNode(
"div",
{
class: vue.normalizeClass(["ui-pagination-control ui-back", { "ui-disabled-status": _ctx.modelValue >= vue.unref(total) }]),
onClick: _cache[1] || (_cache[1] = //@ts-ignore
(...args) => vue.unref(next) && vue.unref(next)(...args))
},
[
vue.renderSlot(_ctx.$slots, "arrow", {}, () => [
vue.createVNode(vue.unref(index$1.UiIcon), { name: "arrow" })
])
],
2
/* CLASS */
)
])
])) : vue.createCommentVNode("v-if", true);
};
}
});
exports.default = _sfc_main;
//# sourceMappingURL=index.vue2.js.map