UNPKG

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)

78 lines (77 loc) 2.63 kB
import { defineComponent as f, 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-panel.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-select.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 J = /* @__PURE__ */ f({ name: "FInput", props: V(), emits: ["update:modelValue"], setup(t, { emit: i }) { 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]), p = I(() => { r.value = t.formData[t.formItem.prop]; }); return s(() => { p(); }), () => { 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) => { i("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 { J as FInput, J as default }; //# sourceMappingURL=f-input.mjs.map