diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index 0e9e3d3..7021f16 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 e47b850..0d7be66 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 2b8ffda..4433829 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 f273443..61a11db 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() @@ -43,13 +44,14 @@ const wrapClass = computed(() => { isMobile.value ? 'p-2' : 'px-3 py-2', props.inversion ? 'bg-[#d2f9d1]' : 'bg-[#f4f6f8]', props.inversion ? 'dark:bg-[#a1dc95]' : 'dark:bg-[#1e1e20]', + props.inversion ? 'message-request' : 'message-reply', { 'text-red-500': props.error }, ] }) const text = computed(() => { const value = props.text ?? '' - if (!props.inversion) + if (!props.asRawText) return mdi.render(value) return value }) @@ -68,7 +70,10 @@ defineExpose({ textRef }) diff --git a/src/views/chat/components/Message/index.vue b/src/views/chat/components/Message/index.vue index 0d462e9..d625a8a 100644 --- a/src/views/chat/components/Message/index.vue +++ b/src/views/chat/components/Message/index.vue @@ -1,5 +1,5 @@