From 19d9806253966ce2ce8d63d418d7c801398582f3 Mon Sep 17 00:00:00 2001 From: Luo Yi <32430186+yilozt@users.noreply.github.com> Date: Sat, 18 Mar 2023 14:32:57 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=94=A8=E4=BA=8E=E5=8E=9F=E6=96=87=E7=9A=84=E9=80=89?= =?UTF-8?q?=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/locales/en-US.ts | 2 ++ src/locales/zh-CN.ts | 2 ++ src/locales/zh-TW.ts | 2 ++ src/views/chat/components/Message/Text.vue | 5 +++-- src/views/chat/components/Message/index.vue | 19 +++++++++++++++---- 5 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index 0e9e3d3e9f..7021f1659f 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -46,6 +46,8 @@ export default { deleteMessageConfirm: 'Are you sure to delete this message?', deleteHistoryConfirm: 'Are you sure to clear this history?', clearHistoryConfirm: 'Are you sure to clear chat history?', + preview: 'Preview', + showRawText: 'Show as raw text', }, setting: { setting: 'Setting', diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index e47b850b07..0d7be6656a 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -46,6 +46,8 @@ export default { deleteMessageConfirm: '是否删除此消息?', deleteHistoryConfirm: '确定删除此记录?', clearHistoryConfirm: '确定清空聊天记录?', + preview: '预览', + showRawText: '显示原文', }, setting: { setting: '设置', diff --git a/src/locales/zh-TW.ts b/src/locales/zh-TW.ts index 2b8ffda90b..4433829b25 100644 --- a/src/locales/zh-TW.ts +++ b/src/locales/zh-TW.ts @@ -46,6 +46,8 @@ export default { deleteMessageConfirm: '是否刪除此訊息?', deleteHistoryConfirm: '確定刪除此紀錄?', clearHistoryConfirm: '確定清除紀錄?', + preview: '預覽', + showRawText: '顯示原文', }, setting: { setting: '設定', diff --git a/src/views/chat/components/Message/Text.vue b/src/views/chat/components/Message/Text.vue index f273443032..e23abac607 100644 --- a/src/views/chat/components/Message/Text.vue +++ b/src/views/chat/components/Message/Text.vue @@ -12,6 +12,7 @@ interface Props { error?: boolean text?: string loading?: boolean + asRawText?: boolean } const props = defineProps() @@ -49,7 +50,7 @@ const wrapClass = computed(() => { const text = computed(() => { const value = props.text ?? '' - if (!props.inversion) + if (!props.asRawText) return mdi.render(value) return value }) @@ -68,7 +69,7 @@ defineExpose({ textRef }) diff --git a/src/views/chat/components/Message/index.vue b/src/views/chat/components/Message/index.vue index 0d462e923a..0c3bfde107 100644 --- a/src/views/chat/components/Message/index.vue +++ b/src/views/chat/components/Message/index.vue @@ -1,5 +1,5 @@