feat: 新增markdown渲染
This commit is contained in:
@@ -8,6 +8,7 @@ import type { FilesCardProps } from 'vue-element-plus-x/types/FilesCard';
|
||||
import type { ThinkingStatus } from 'vue-element-plus-x/types/Thinking';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { useHookFetch } from 'hook-fetch/vue';
|
||||
import { ref } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { send } from '@/api';
|
||||
import FilesSelect from '@/components/FilesSelect/index.vue';
|
||||
@@ -81,7 +82,6 @@ watch(
|
||||
await chatStore.requestChatList(`${_id_}`);
|
||||
// 请求聊天记录后,赋值回显,并滚动到底部
|
||||
bubbleItems.value = chatStore.chatMap[`${_id_}`] as MessageItem[];
|
||||
|
||||
// 滚动到底部
|
||||
setTimeout(() => {
|
||||
bubbleListRef.value!.scrollToBottom();
|
||||
@@ -265,6 +265,11 @@ watch(
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
function markdownContent(item: any) {
|
||||
console.log('item---', item);
|
||||
return item.content;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -277,6 +282,10 @@ watch(
|
||||
:status="item.thinkingStatus" class="thinking-chain-warp" @change="handleChange"
|
||||
/>
|
||||
</template>
|
||||
<!-- 自定义气泡内容 -->
|
||||
<template #content="{ item }">
|
||||
<XMarkdown :markdown="markdownContent(item)" />
|
||||
</template>
|
||||
</BubbleList>
|
||||
|
||||
<Sender
|
||||
|
||||
Reference in New Issue
Block a user