UNPKG

lwx-test-ui

Version:

lwx-test-ui

29 lines (28 loc) 1 kB
import { defineComponent as d, inject as f, computed as _, resolveComponent as h, createBlock as x, openBlock as C, unref as g, isRef as v } from "vue"; import { useGlobalProperties as I } from "../../../hooks/use-global-properties/index.js"; import { inputEmits as V, inputProps as b } from "./input.js"; import { useInput as k } from "./use-input.js"; const y = /* @__PURE__ */ d({ name: "LwxInput", __name: "input", props: b, emits: V, setup(r, { emit: p }) { const o = r, m = p, u = I(), t = f(u.formItemContextKey, void 0), a = _(() => t ? `请输入${t.label}` : o.placeholder), { modelValue: e } = k(o); function c(n) { m("change", n); } return (n, l) => { const i = h("el-input"); return C(), x(i, { modelValue: g(e), "onUpdate:modelValue": l[0] || (l[0] = (s) => v(e) ? e.value = s : null), placeholder: a.value, onChange: c }, null, 8, ["modelValue", "placeholder"]); }; } }); export { y as default };