@pit-front-end/components
Version:
湖南创智艾泰克科技有限公司
36 lines (35 loc) • 1.02 kB
JavaScript
import { defineComponent as d, resolveComponent as p, createBlock as m, openBlock as u, unref as c, isRef as h } from "vue";
import { switchEmits as f, switchProps as w } from "./switch.js";
import { usePitSwitch as _ } from "./use-switch.js";
const V = /* @__PURE__ */ d({
name: "PitSwitch",
inheritAttrs: !1,
__name: "switch",
props: w,
emits: f,
setup(a, { emit: t }) {
const e = a, { modelValue: o } = _(e), l = {
handleInput(n) {
t("input", n);
},
handleChange(n) {
t("change", n);
}
};
return (n, s) => {
const i = p("el-switch");
return u(), m(i, {
modelValue: c(o),
"onUpdate:modelValue": s[0] || (s[0] = (r) => h(o) ? o.value = r : null),
disabled: e.disabled,
size: e.size,
readonly: e.readonly,
onInput: l.handleInput,
onChange: l.handleChange
}, null, 8, ["modelValue", "disabled", "size", "readonly", "onInput", "onChange"]);
};
}
});
export {
V as default
};