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)
62 lines (61 loc) • 2.16 kB
JavaScript
import { defineComponent as x, computed as v, createVNode as u, mergeProps as D, h as n } from "vue";
import { ElSelect as y, ElOption as I } from "element-plus";
import { clearSymbol as b } from "../utils/index.mjs";
import { componentProps as h, useEvent as S, isProperty as g } from "../powerful-form/src/form-view-data.mjs";
const w = /* @__PURE__ */ x({
name: "FSelect",
props: h(),
setup(e) {
const m = v(() => e.formItem.data), {
event: c
} = S({
formData: e.formData,
index: e.index,
formItem: e.formItem
});
return () => {
var f, r;
return u(y, D({
modelValue: e.formData[e.formItem.prop],
"onUpdate:modelValue": (a) => e.formData[e.formItem.prop] = a,
style: ((f = m.value) == null ? void 0 : f.style) || (e.inline ? {
width: "192px"
} : {
width: "100%"
}),
onChange: (...a) => {
c("change", ...a);
},
placeholder: `请选择${b(e.formItem.text)}`,
clearable: !0
}, g({
formData: e.formData,
index: e.index,
formItem: e.formItem
}, (r = m.value) == null ? void 0 : r.property)), {
default: () => {
var a, t, l, d, i;
return ((l = (t = (a = m.value) == null ? void 0 : a.slots) == null ? void 0 : t.default) == null ? void 0 : l.call(t, n, e.formData, e.index)) || ((i = (d = m.value) == null ? void 0 : d.options) == null ? void 0 : i.map((o) => u(I, {
key: o.value,
label: o.label,
value: o.value,
disabled: o.disabled
}, null)));
},
empty: () => {
var a, t, l;
return (l = (t = (a = m.value) == null ? void 0 : a.slots) == null ? void 0 : t.empty) == null ? void 0 : l.call(t, n, e.formData, e.index);
},
prefix: () => {
var a, t, l;
return (l = (t = (a = m.value) == null ? void 0 : a.slots) == null ? void 0 : t.prefix) == null ? void 0 : l.call(t, n, e.formData, e.index);
}
});
};
}
});
export {
w as FSelect,
w as default
};
//# sourceMappingURL=f-select.mjs.map