el-plus-powerful-form
Version:
## [DOCS](https://peng-xiao-shuai.github.io/vite-vue-admin-docs/zh-CN/component_directive/component/powerful-form-doc.html)
39 lines (38 loc) • 1.14 kB
JavaScript
import { defineComponent as f, computed as l, createVNode as n, Fragment as i, mergeProps as d } from "vue";
import { ElSwitch as u } from "element-plus";
import { componentProps as c, useEvent as v, isProperty as I } from "../powerful-form/src/form-view-data.mjs";
const g = /* @__PURE__ */ f({
name: "FSwitch",
props: c(),
setup(e) {
const m = l(() => e.formItem.data), {
event: r
} = v({
formData: e.formData,
index: e.index,
formItem: e.formItem
});
return () => {
var a, o;
return n(i, null, [n(u, d({
style: ((a = m.value) == null ? void 0 : a.style) || {},
modelValue: e.formData[e.formItem.prop],
"onUpdate:modelValue": (t) => e.formData[e.formItem.prop] = t,
"active-value": "1",
"inactive-value": "0",
onChange: (...t) => {
r("change", ...t);
}
}, I({
formData: e.formData,
index: e.index,
formItem: e.formItem
}, (o = m.value) == null ? void 0 : o.property)), null)]);
};
}
});
export {
g as FSwitch,
g as default
};
//# sourceMappingURL=f-switch.mjs.map