@layui/layui-vue
Version:
a component library for Vue 3 base on layui-vue
18 lines (17 loc) • 1.77 kB
JavaScript
import { defineComponent as y, inject as f, computed as n, openBlock as b, createBlock as v, withCtx as p, createVNode as m, unref as u } from "vue";
import { LayIcon as r } from "@layui/icons-vue";
import T from "../../page/index2.js";
import { LAY_TABLE_CONTEXT as B } from "../constant.js";
const P = y({ name: "LayTablePage", __name: "TablePage", props: { total: {}, limit: {}, theme: {}, pages: {}, limits: {}, hideOnSinglePage: { type: Boolean }, ellipsisTooltip: { type: Boolean }, disabled: { type: Boolean }, layout: { default: () => ["prev", "page", "next", "limits", "skip"] }, current: {}, change: {} }, emits: ["update:current", "update:limit"], setup(g, { emit: d }) {
const { tableEmits: c } = f(B), a = g, i = d, o = n({ get: () => a.current, set(e) {
i("update:current", e);
} }), s = n({ get: () => a.limit, set(e) {
i("update:limit", e);
} }), h = (e) => {
a.change || console.warn("layui-vue: LayTable的change事件,将在未来版本中废弃,请将回调函数移至为props.page中的change属性。"), c("change", e), a.change && a.change(e);
};
return (e, t) => (b(), v(T, { total: e.total, theme: e.theme, pages: e.pages, layout: e.layout, limits: e.limits, disabled: e.disabled, "hide-on-single-page": e.hideOnSinglePage, "ellipsis-tooltip": e.ellipsisTooltip, modelValue: o.value, "onUpdate:modelValue": t[0] || (t[0] = (l) => o.value = l), limit: s.value, "onUpdate:limit": t[1] || (t[1] = (l) => s.value = l), onChange: h }, { prev: p(() => [m(u(r), { type: "layui-icon-left" })]), next: p(() => [m(u(r), { type: "layui-icon-right" })]), _: 1 }, 8, ["total", "theme", "pages", "layout", "limits", "disabled", "hide-on-single-page", "ellipsis-tooltip", "modelValue", "limit"]));
} });
export {
P as default
};