vuux
Version:
Vue3 Nuxt3 Nuxt4 组件库
45 lines (44 loc) • 1.71 kB
JavaScript
import { defineComponent as f, useSlots as w, createElementBlock as l, createCommentVNode as s, openBlock as o, normalizeClass as n, unref as t, createElementVNode as C, Fragment as d, renderList as B, normalizeStyle as S, createBlock as V, renderSlot as N, withModifiers as $, createTextVNode as F, toDisplayString as H } from "vue";
import { CheckBox as U } from "../../CheckBox/index.mjs";
import { useTableHeader as _ } from "./hook/useTableHeader.mjs";
const z = /* @__PURE__ */ f({
__name: "header",
props: {
columns: {},
tableData: {},
isFixedHead: { type: Boolean }
},
setup(p) {
const r = p, i = w(), { classNames: c, isFixedHead: u, isPartiallySelect: m, isModel: h, onUpdate: k } = _(r);
return (x, a) => r.columns ? (o(), l("thead", {
key: 0,
class: n({ "is-fixed": t(u) })
}, [
C("tr", null, [
(o(!0), l(d, null, B(r.columns, (e, y) => (o(), l("th", {
key: y,
class: n(t(c)(e)),
style: S(`width: ${e.width}px; min-width: ${e.width}px; max-width: ${e.width}px`)
}, [
e.prop == "select" ? (o(), V(t(U), {
key: 0,
"model-value": t(h),
indeterminate: t(m),
"onUpdate:modelValue": t(k),
onClickCapture: a[0] || (a[0] = $(() => {
}, ["stop"]))
}, null, 8, ["model-value", "indeterminate", "onUpdate:modelValue"])) : s("", !0),
t(i)["head-" + e.prop] ? N(x.$slots, "head-" + e.prop, {
key: 1,
scope: e
}) : (o(), l(d, { key: 2 }, [
F(H(e.title), 1)
], 64))
], 6))), 128))
])
], 2)) : s("", !0);
}
});
export {
z as default
};