mine-h5-ui
Version:
一款轻量级、模块化基于 Vue3.x 的 H5 前端 UI 组件库 👍
33 lines (32 loc) • 1.25 kB
JavaScript
import { defineComponent as c, useModel as r, openBlock as f, createElementBlock as p, unref as t, normalizeStyle as k, normalizeClass as b, createElementVNode as y, mergeModels as d } from "vue";
import { useHandler as C } from "./hooks.js";
const v = ["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(e, { emit: n }) {
const s = n, i = e, a = r(e, "modelValue"), { background: m, handleClick: o } = C({ props: i, emit: s, isActived: a });
return (z, l) => (f(), p("div", {
class: b(["me-switch", { "me-switch-on": a.value }]),
"data-disabled": e.disabled,
style: k(`font-size:${e.size};background:${t(m)};`),
onClick: l[0] || (l[0] = //@ts-ignore
(...u) => t(o) && t(o)(...u))
}, [...l[1] || (l[1] = [
y("span", { class: "round" }, null, -1)
])], 14, v));
}
});
export {
V as default
};