mine-h5-ui
Version:
一款轻量级、模块化基于 Vue3.x 的 H5 前端 UI 组件库 👍
48 lines (47 loc) • 1.57 kB
JavaScript
import { defineComponent as u, mergeModels as n, useModel as f, createElementBlock as p, openBlock as k, unref as l, createVNode as h, createElementVNode as C, renderSlot as b } from "vue";
import v from "../MeIcon/index.vue.js";
import { useHandler as V } from "./hooks.js";
/*!
* mine-h5-ui v2.15.0
* Copyright (c) 2025 biaov
* @license MIT
*/
const z = ["data-checked", "data-disabled"], B = { class: "value" }, N = /* @__PURE__ */ u({
name: "MeCheckbox",
__name: "index",
props: /* @__PURE__ */ n({
name: { default: "" },
shape: { default: "round" },
icon: { default: "" },
iconSelect: { default: "" },
iconSize: { default: "20px" },
checkedColor: { default: "" },
disabled: { type: Boolean, default: !1 }
}, {
modelValue: { type: Boolean, default: !1 },
modelModifiers: {}
}),
emits: /* @__PURE__ */ n(["click"], ["update:modelValue"]),
setup(a, { emit: c }) {
const s = c, i = a, o = f(a, "modelValue"), { iconName: m, handleClick: d } = V({ props: i, emit: s, isChecked: o });
return (e, t) => (k(), p("div", {
class: "me-checkbox",
onClick: t[0] || (t[0] = //@ts-ignore
(...r) => l(d) && l(d)(...r)),
"data-checked": o.value + "",
"data-disabled": e.disabled + ""
}, [
h(v, {
name: l(m),
color: o.value ? e.checkedColor : "",
size: e.iconSize
}, null, 8, ["name", "color", "size"]),
C("div", B, [
b(e.$slots, "default")
])
], 8, z));
}
});
export {
N as default
};