acdr-ui/dist/dev/mp-weixin/modules/mall/chat/components/messageInput.js

68 lines
1.9 KiB
JavaScript
Raw Normal View History

2024-09-19 07:20:14 +08:00
"use strict";
const common_vendor = require("../../../../common/vendor.js");
if (!Array) {
const _easycom_uni_easyinput2 = common_vendor.resolveComponent("uni-easyinput");
_easycom_uni_easyinput2();
}
const _easycom_uni_easyinput = () => "../../../../uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js";
if (!Math) {
_easycom_uni_easyinput();
}
const _sfc_main = {
__name: "messageInput",
props: {
// 消息
modelValue: {
type: String,
default: ""
},
// 工具模式
toolsMode: {
type: String,
default: ""
}
},
emits: ["update:modelValue", "onTools", "sendMessage"],
setup(__props, { emit: __emit }) {
const props = __props;
const emits = __emit;
const message = common_vendor.computed({
get() {
return props.modelValue;
},
set(newValue) {
emits(`update:modelValue`, newValue);
}
});
function onTools(mode) {
emits("onTools", mode);
}
function sendMessage() {
emits("sendMessage");
}
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.o(($event) => message.value = $event),
b: common_vendor.p({
inputBorder: false,
clearable: false,
placeholder: "请输入你要咨询的问题",
modelValue: message.value
}),
c: common_vendor.o(($event) => onTools("emoji")),
d: !message.value
}, !message.value ? {
e: __props.toolsMode === "tools" ? 1 : "",
f: common_vendor.o(($event) => onTools("tools"))
} : {}, {
g: message.value
}, message.value ? {
h: common_vendor.o(sendMessage)
} : {});
};
}
};
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-e2d400c1"]]);
wx.createComponent(Component);
//# sourceMappingURL=messageInput.js.map