From 2c4ad9f78a0d5ee3aedfdf467b410c3e40f8e2df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E8=B6=8A?= <552369664@qq.com> Date: Sun, 25 Aug 2024 19:42:04 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E3=80=91=E4=BF=AE=E5=A4=8D=E5=AE=A2=E6=9C=8D=E8=81=8A=E5=A4=A9?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=A1=B5=E7=82=B9=E5=87=BB=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=8D=A1=E7=89=87=E6=97=A0=E6=B3=95=E6=98=BE=E7=A4=BA=E5=95=86?= =?UTF-8?q?=E5=93=81=E8=AF=A6=E6=83=85=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/chat/components/messageListItem.vue | 65 ++++++++++++----------- 1 file changed, 35 insertions(+), 30 deletions(-) diff --git a/pages/chat/components/messageListItem.vue b/pages/chat/components/messageListItem.vue index 0634878b..06a718de 100644 --- a/pages/chat/components/messageListItem.vue +++ b/pages/chat/components/messageListItem.vue @@ -4,12 +4,20 @@ - + {{ formatDate(message.createTime) }} - + {{ message.content }} @@ -18,32 +26,35 @@ v-if="message.contentType !== KeFuMessageContentTypeEnum.SYSTEM" class="ss-flex ss-col-top" :class="[ - message.senderType === UserTypeEnum.ADMIN - ? `ss-row-left` - : message.senderType === UserTypeEnum.MEMBER - ? `ss-row-right` - : '', - ]" + message.senderType === UserTypeEnum.ADMIN + ? `ss-row-left` + : message.senderType === UserTypeEnum.MEMBER + ? `ss-row-right` + : '', + ]" > @@ -104,7 +109,7 @@ // 消息 message: { type: Object, - default: ()=>({}), + default: () => ({}), }, // 消息索引 messageIndex: { @@ -112,10 +117,10 @@ default: 0, }, // 消息列表 - messageList:{ + messageList: { type: Array, default: () => [], - } + }, }); const getMessageContent = computed(() => (item) => JSON.parse(item.content)); // 解析消息内容