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)
77 lines (76 loc) • 2.58 kB
JavaScript
import { defineComponent as p, computed as d, ref as c, watchEffect as I, onUnmounted as s, createVNode as a, Fragment as y, mergeProps as v } from "vue";
import { ElInput as x } from "element-plus";
import "element-plus/theme-chalk/el-form.css";
import "element-plus/theme-chalk/el-form-item.css";
import "element-plus/theme-chalk/el-checkbox.css";
import "element-plus/theme-chalk/el-checkbox-group.css";
import "element-plus/theme-chalk/el-date-picker.css";
import "element-plus/theme-chalk/el-radio.css";
import "element-plus/theme-chalk/el-radio-group.css";
import "element-plus/theme-chalk/el-select-v2.css";
import "element-plus/theme-chalk/el-switch.css";
import "element-plus/theme-chalk/el-input.css";
import "element-plus/theme-chalk/el-rate.css";
import "../style.css";
import { FormTypeEnum as D } from "../powerful-form/index.mjs";
import { componentProps as V, useEvent as g, isProperty as F } from "../powerful-form/src/form-view-data.mjs";
import { clearSymbol as b } from "../utils/index.mjs";
const H = /* @__PURE__ */ p({
name: "FInput",
props: V(),
emits: ["update:modelValue"],
setup(t, {
emit: f
}) {
const m = d(() => t.formItem.data), {
event: o
} = g({
formData: t.formData,
index: t.index,
formItem: t.formItem
}), r = c(t.formData[t.formItem.prop]), i = I(() => {
r.value = t.formData[t.formItem.prop];
});
return s(() => {
i();
}), () => {
var n, l, u;
return a(y, null, [a(x, v({
style: ((n = m.value) == null ? void 0 : n.style) || {},
placeholder: `请输入${b(t.formItem.text)}`,
modelValue: r.value,
"onUpdate:modelValue": (e) => r.value = e,
onBlur: (...e) => o("blur", ...e),
onFocus: (...e) => o("focus", ...e),
onChange: (e) => {
f("update:modelValue", e), o("change", e);
},
onInput: (...e) => o("input", ...e),
onClear: (...e) => o("clear", ...e)
}, {
rows: 3,
clearable: !0,
type: t.formItem.type || D.Input,
...F({
formData: t.formData,
index: t.index,
formItem: t.formItem
}, (l = m.value) == null ? void 0 : l.property)
}), {
[(u = m.value) == null ? void 0 : u.slot]: () => {
var e;
return a("span", {
style: {
padding: "0 10px"
}
}, [(e = m.value) == null ? void 0 : e.symbol]);
}
})]);
};
}
});
export {
H as FInput,
H as default
};
//# sourceMappingURL=f-input.mjs.map