mine-h5-ui
Version:
一款轻量级、模块化基于 Vue3.x 的 H5 前端 UI 组件库 👍
38 lines (37 loc) • 1.35 kB
JavaScript
import { defineComponent as c, mergeModels as d, useModel as f, createElementBlock as p, openBlock as k, normalizeStyle as b, unref as l, normalizeClass as y, createElementVNode as C } from "vue";
import { useHandler as v } from "./hooks.js";
/*!
* mine-h5-ui v2.15.0
* Copyright (c) 2025 biaov
* @license MIT
*/
const z = ["data-disabled"], V = /* @__PURE__ */ c({
name: "MeSwitch",
__name: "index",
props: /* @__PURE__ */ d({
size: { default: "" },
activeColor: { default: "" },
inactiveColor: { default: "" },
async: { type: Boolean, default: !1 },
disabled: { type: Boolean, default: !1 }
}, {
modelValue: { type: Boolean, default: !1 },
modelModifiers: {}
}),
emits: /* @__PURE__ */ d(["click"], ["update:modelValue"]),
setup(o, { emit: n }) {
const i = n, r = o, a = f(o, "modelValue"), { background: m, handleClick: t } = v({ props: r, emit: i, isActived: a });
return (s, e) => (k(), p("div", {
class: y(["me-switch", { "me-switch-on": a.value }]),
"data-disabled": s.disabled,
onClick: e[0] || (e[0] = //@ts-ignore
(...u) => l(t) && l(t)(...u)),
style: b(`font-size:${s.size};background:${l(m)};`)
}, e[1] || (e[1] = [
C("span", { class: "round" }, null, -1)
]), 14, z));
}
});
export {
V as default
};