From 4e8520f5995eba932523715c18668b2b8a857840 Mon Sep 17 00:00:00 2001 From: DCloud_JSON Date: Wed, 19 Jun 2024 20:58:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20web-pc=20=E7=9A=84?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E8=8F=9C=E5=8D=95=E6=89=A9=E5=B1=95=E7=82=B9?= =?UTF-8?q?=EF=BC=8C=E4=BC=A0=E5=85=A5=E7=9A=84=E4=BC=9A=E8=AF=9D=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=89=BE=E4=B8=8D=E5=88=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../uni-im-chat-input/uni-im-chat-input.vue | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/components/uni-im-chat-input/uni-im-chat-input.vue b/components/uni-im-chat-input/uni-im-chat-input.vue index 0e4fbc4..268d36b 100644 --- a/components/uni-im-chat-input/uni-im-chat-input.vue +++ b/components/uni-im-chat-input/uni-im-chat-input.vue @@ -95,13 +95,27 @@ ], emojiCodes, chatInputBoxHeight:'auto', - extToolBar: [] } }, computed: { canSend() { return typeof this.modelValue != "string" || this.modelValue.trim().length > 0; + }, + // #ifdef H5 + extToolBar(){ + // 调用扩展点,扩展程序可以在消息输入框新增一个工具类的项 + const currentConversationId = uniIm.currentConversationId + return uniIm.extensions + .invokeExts("input-msg-tool-bar",uniIm.conversation.getCached(currentConversationId)) + .filter((result) => result && result.component) + .map((result) => { + return { + component: markRaw(result.component), + props: result.props||{} + }; + }); } + // #endif }, props: { modelValue: { @@ -118,18 +132,7 @@ } }, mounted() { - // 调用扩展点,扩展程序可以在消息输入框新增一个工具类的项 - this.extToolBar = uniIm.extensions - .invokeExts("input-msg-tool-bar",this.conversation) - .filter((result) => result && result.component) - .map((result) => { - return { - component: markRaw(result.component), - props: result.props||{} - }; - }); currentModelValue = this.modelValue; - // #ifdef H5 // pc宽屏支持拖动改变输入框高度 if(uniIm.isWidescreen){ -- GitLab