88 lines
3.0 KiB
JavaScript
88 lines
3.0 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const components_hsInput_reducer = require("./reducer.js");
|
|
if (!Array) {
|
|
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
|
|
_easycom_uni_icons2();
|
|
}
|
|
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
|
|
if (!Math) {
|
|
_easycom_uni_icons();
|
|
}
|
|
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
__name: "hs-input",
|
|
props: components_hsInput_reducer.wlInputProps,
|
|
emits: ["update:valueModel", "input", "blur", "bindconfirm", "onClose"],
|
|
setup(__props, { emit }) {
|
|
const props = __props;
|
|
const valueModel = common_vendor.ref("");
|
|
common_vendor.watch(
|
|
() => props.valueModel,
|
|
(val) => {
|
|
valueModel.value = val;
|
|
handleChange(val);
|
|
}
|
|
);
|
|
common_vendor.onMounted(() => {
|
|
valueModel.value = props.valueModel;
|
|
handleChange(props.valueModel);
|
|
});
|
|
const onChange = (e) => {
|
|
const target = e.target;
|
|
let value = target.value;
|
|
handleChange(value);
|
|
};
|
|
const handleChange = (value) => {
|
|
emit("update:valueModel", value);
|
|
emit("input", value);
|
|
};
|
|
const onBlur = () => {
|
|
emit("blur", props.valueModel);
|
|
};
|
|
const onConfirm = (e) => {
|
|
const target = e.target;
|
|
let value = target.value;
|
|
emit("bindconfirm", value);
|
|
};
|
|
const emptyInput = () => {
|
|
valueModel.value = "";
|
|
onChange({ target: { value: "" } });
|
|
};
|
|
return (_ctx, _cache) => {
|
|
return common_vendor.e({
|
|
a: common_vendor.n(props.classInputName),
|
|
b: common_vendor.o([($event) => valueModel.value = $event.detail.value, onChange]),
|
|
c: props.placeholderStyle,
|
|
d: (props == null ? void 0 : props.width) || "300rpx",
|
|
e: props == null ? void 0 : props.textAlign,
|
|
f: common_vendor.o(onChange),
|
|
g: (props == null ? void 0 : props.placeholder) || "请输入",
|
|
h: (props == null ? void 0 : props.maxLength) || 255,
|
|
i: (props == null ? void 0 : props.type) || "text",
|
|
j: common_vendor.o(onBlur),
|
|
k: common_vendor.o(onConfirm),
|
|
l: props == null ? void 0 : props.disabled,
|
|
m: props == null ? void 0 : props.confirmType,
|
|
n: (props == null ? void 0 : props.password) || false,
|
|
o: valueModel.value,
|
|
p: valueModel.value.length
|
|
}, valueModel.value.length ? {
|
|
q: common_vendor.o(emptyInput),
|
|
r: common_vendor.p({
|
|
type: "closeempty",
|
|
color: "#999999",
|
|
size: "12"
|
|
})
|
|
} : {}, {
|
|
s: _ctx.suffix
|
|
}, _ctx.suffix ? {
|
|
t: common_vendor.t(_ctx.suffix)
|
|
} : {}, {
|
|
v: common_vendor.n(props.className)
|
|
});
|
|
};
|
|
}
|
|
});
|
|
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "/Users/zsq/Sources/github/2025property-pay/pay-customer/src/components/hs-input/hs-input.vue"]]);
|
|
wx.createComponent(Component);
|