UNPKG

egova-admin-web

Version:

新版统一用户中心前端项目

71 lines (70 loc) 2.01 kB
import { defineComponent as s, ref as p, watch as h, openBlock as v, createBlock as f, computed as i } from "vue"; import { Input as _ } from "ant-design-vue/es"; /*! egova-admin-web v2.4.12-r210.4 */ const g = s({ name: "InputPassword" }), y = /* @__PURE__ */ s({ ...g, props: { placeholder: { type: String, default: "" }, disabled: Boolean, value: { type: String, default: void 0 }, showSuffix: { type: Boolean, default: !0 } // 显示明文切换图标-预留扩展 }, emits: ["update:value"], setup(t, { emit: d }) { const l = t, e = p(""), a = p(""), u = p(!1); h( () => l.value, () => { n(); }, { immediate: !0 } ); function n() { u.value ? a.value = l.value ?? "" : a.value = "•".repeat((l.value ?? "").length); } function r(c) { const o = c.target.value; o.length > a.value.length ? e.value += o.slice(a.value.length) : e.value = e.value.slice(0, o.length), d("update:value", e.value); } return (c, o) => { const m = _; return v(), f(m, { value: a.value, placeholder: t.placeholder, disabled: t.disabled, onInput: r }, null, 8, ["value", "placeholder", "disabled"]); }; } }), w = s({ name: "DynamicFormPassword" }), B = /* @__PURE__ */ s({ ...w, props: { value: { type: String, default: void 0 }, field: { type: Object, default: () => ({}) }, config: { type: Object, default: () => ({}) } }, emits: ["update:value"], setup(t, { emit: d }) { const l = t, e = i({ get: () => l.value, set: (u) => { d("update:value", u); } }), a = i(() => l.config.placeholder ?? "请输入"); return (u, n) => (v(), f(y, { value: e.value, "onUpdate:value": n[0] || (n[0] = (r) => e.value = r), valueModifiers: { trim: !0 }, placeholder: a.value, class: "zt-dynamic-form-input" }, null, 8, ["value", "placeholder"])); } }); export { B as default };