UNPKG

lwx-test-ui

Version:

lwx-test-ui

35 lines (34 loc) 1.17 kB
import { defineComponent as d, inject as x, computed as r, resolveComponent as f, createBlock as h, openBlock as w, mergeProps as g } from "vue"; import { useGlobalProperties as V } from "../../../hooks/use-global-properties/index.js"; import { textareaEmits as _, textareaProps as v } from "./textarea.js"; const P = /* @__PURE__ */ d({ name: "LwxTextarea", __name: "textarea", props: v, emits: _, setup(m, { emit: n }) { const e = m, s = n, p = V(), o = x(p.formItemContextKey, void 0), u = r(() => o ? `请输入${o.label}` : e.placeholder), a = r({ get() { return e.modelValue; }, set(t) { s("update:modelValue", t); } }); return (t, l) => { const i = f("el-input"); return w(), h(i, g({ modelValue: a.value, "onUpdate:modelValue": l[0] || (l[0] = (c) => a.value = c), type: "textarea", autosize: { minRows: e.minRows, maxRows: e.maxRows }, maxlength: e.maxlength, placeholder: u.value, "show-word-limit": "" }, t.$attrs), null, 16, ["modelValue", "autosize", "maxlength", "placeholder"]); }; } }); export { P as default };